|
| 1 | +# |
| 2 | +# PLEASE NOTE: Managed workflow - do not change manually |
| 3 | +# |
| 4 | +name: Release |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch: {} |
| 8 | + |
| 9 | +concurrency: |
| 10 | + # only run one publishing at a time to avoid conflicts |
| 11 | + group: publish-${{ github.ref }} |
| 12 | + |
| 13 | +env: |
| 14 | + # renovate: datasource=npm depName=@semantic-release/changelog |
| 15 | + SEMANTIC_RELEASE_CHANGELOG_VERSION: 6.0.3 |
| 16 | + |
| 17 | + # renovate: datasource=npm depName=@semantic-release/git |
| 18 | + SEMANTIC_RELEASE_GIT_VERSION: 10.0.1 |
| 19 | + |
| 20 | + # renovate: datasource=npm depName=conventional-changelog-conventionalcommits |
| 21 | + CONVENTIONAL_CHANGELOG_CONVENTIONALCOMMITS_VERSION: 9.1.0 |
| 22 | + |
| 23 | +jobs: |
| 24 | + release: |
| 25 | + name: Release |
| 26 | + runs-on: ubuntu-latest |
| 27 | + |
| 28 | + outputs: |
| 29 | + release-published: ${{ steps.release.outputs.new_release_published }} |
| 30 | + release-version: ${{ steps.release.outputs.new_release_version }} |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Determine app token for release |
| 34 | + uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0 |
| 35 | + id: app-token |
| 36 | + with: |
| 37 | + app-id: ${{ secrets.WE_RELEASE_GITHUB_APP_ID }} |
| 38 | + private-key: ${{ secrets.WE_RELEASE_GITHUB_PRIVATE_KEY }} |
| 39 | + |
| 40 | + - name: Checkout |
| 41 | + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| 42 | + with: |
| 43 | + token: ${{ steps.app-token.outputs.token }} |
| 44 | + # Note: special permissions for push to protected branch required |
| 45 | + # Credentials required for semantic-release-github-actions-tags |
| 46 | + # persist-credentials: false |
| 47 | + |
| 48 | + - name: Create release configuration file |
| 49 | + if: ${{ hashFiles('.releaserc.yml') == '' }} |
| 50 | + shell: bash |
| 51 | + # TODO rather use a template? |
| 52 | + run: | |
| 53 | + cat <<EOF > .releaserc.yml |
| 54 | + --- |
| 55 | + branches: ${{ github.head_ref || github.ref_name }} |
| 56 | +
|
| 57 | + plugins: |
| 58 | + - - "@semantic-release/commit-analyzer" |
| 59 | + # see https://github.com/semantic-release/commit-analyzer?tab=readme-ov-file#options |
| 60 | + - preset: conventionalcommits |
| 61 | + - - "@semantic-release/release-notes-generator" |
| 62 | + # see https://github.com/semantic-release/release-notes-generator?tab=readme-ov-file#options |
| 63 | + - preset: conventionalcommits |
| 64 | + presetConfig: |
| 65 | + issuePrefixes: ['ING-', 'WGS-', 'SVC-'] |
| 66 | + issueUrlFormat: 'https://wetransform.atlassian.net/browse/{{prefix}}{{id}}' |
| 67 | + parserOpts: |
| 68 | + # https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser#referenceactions |
| 69 | + # set to null to reference an issue without action (but will still show it "closes" the issue in the changelog) |
| 70 | + # referenceActions: null |
| 71 | + - "@semantic-release/changelog" |
| 72 | + - - "@semantic-release/git" |
| 73 | + - assets: |
| 74 | + - CHANGELOG.md |
| 75 | + - "@semantic-release/github" |
| 76 | + EOF |
| 77 | +
|
| 78 | + - name: Install NodeJs |
| 79 | + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 |
| 80 | + with: |
| 81 | + node-version: 24 # semantic-release 25 requires NodeJs 22 or 24 |
| 82 | + |
| 83 | + - name: Release |
| 84 | + id: release |
| 85 | + uses: cycjimmy/semantic-release-action@b12c8f6015dc215fe37bc154d4ad456dd3833c90 # v6.0.0 |
| 86 | + env: |
| 87 | + # Permissions needed |
| 88 | + # contents: write |
| 89 | + # issues: write |
| 90 | + # pull-requests: write |
| 91 | + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
| 92 | + GIT_AUTHOR_NAME: wetransform Bot |
| 93 | + GIT_AUTHOR_EMAIL: 113353961+wetransformer@users.noreply.github.com |
| 94 | + GIT_COMMITTER_NAME: wetransform Bot |
| 95 | + GIT_COMMITTER_EMAIL: 113353961+wetransformer@users.noreply.github.com |
| 96 | + RUNNER_DEBUG: 1 |
| 97 | + with: |
| 98 | + # dry_run: true |
| 99 | + semantic_version: 25.0.2 |
| 100 | + |
| 101 | + extra_plugins: |
| 102 | + "@semantic-release/changelog@\ |
| 103 | + ${{ env.SEMANTIC_RELEASE_CHANGELOG_VERSION }} \ |
| 104 | + @semantic-release/git@\ |
| 105 | + ${{ env.SEMANTIC_RELEASE_GIT_VERSION }} \ |
| 106 | + conventional-changelog-conventionalcommits@\ |
| 107 | + ${{ env.CONVENTIONAL_CHANGELOG_CONVENTIONALCOMMITS_VERSION }} \ |
| 108 | + " |
0 commit comments