π Release #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π Release | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [closed] | |
permissions: | |
id-token: write # Required for OIDC token generation | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
jobs: | |
yarn-release: | |
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
name: Create release using commit-and-tag-version | |
steps: | |
- name: Get GitHub App Token | |
id: token | |
uses: SocialGouv/token-bureau@main | |
with: | |
token-bureau-url: https://token-bureau.fabrique.social.gouv.fr | |
audience: socialgouv | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.token.outputs.token }} | |
- name: Install dependencies | |
run: yarn | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.SOCIALGROOVYBOT_GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.SOCIALGROOVYBOT_GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_push_gpgsign: false | |
git_tag_gpgsign: true | |
- name: Run release | |
env: | |
GIT_AUTHOR_EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }} | |
GIT_AUTHOR_NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }} | |
GIT_COMMITTER_EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }} | |
GIT_COMMITTER_NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }} | |
run: yarn release | |
- name: Push release | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git remote set-url --push origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
git push -f --follow-tags origin main |