ci(deps): bump actions/create-github-app-token from 3.0.0 to 3.1.1 #372
Workflow file for this run
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
| # Release | |
| # | |
| # Publish a GitHub release on release branch merge or workflow dispatch. | |
| # | |
| # References: | |
| # | |
| # - https://cli.github.com/manual/gh_release_create | |
| # - https://docs.github.com/actions/learn-github-actions/contexts | |
| # - https://docs.github.com/actions/learn-github-actions/expressions | |
| # - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request | |
| # - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
| # - https://docs.github.com/actions/using-workflows/using-github-cli-in-workflows | |
| # - https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions | |
| # - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request | |
| # - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch | |
| # - https://git-scm.com/book/en/v2/Git-Basics-Tagging | |
| # - https://github.com/actions/checkout | |
| # - https://github.com/actions/create-github-app-token | |
| # - https://github.com/crazy-max/ghaction-import-gpg | |
| # - https://github.com/flex-development/dist-tag-action | |
| # - https://github.com/flex-development/grease | |
| # - https://github.com/hmarr/debug-action | |
| # - https://github.com/oven-sh/setup-bun | |
| --- | |
| name: release | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - closed | |
| workflow_dispatch: | |
| inputs: | |
| sha: | |
| description: release commit sha | |
| required: true | |
| type: string | |
| env: | |
| REF: ${{ inputs.sha || github.event.pull_request.merge_commit_sha }} | |
| REF_NAME: | | |
| ${{ format('{0}@{1}', github.base_ref, inputs.sha || github.event.pull_request.merge_commit_sha) }} | |
| jobs: | |
| preflight: | |
| if: | | |
| (github.event.pull_request.merged && startsWith(github.head_ref, 'release/')) || | |
| (github.event_name == 'workflow_dispatch' && github.ref_name == 'main') | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| outputs: | |
| prerelease: ${{ steps.dist-tag.outputs.prerelease }} | |
| tag: ${{ steps.tag.outputs.result }} | |
| version: ${{ steps.version.outputs.result }} | |
| steps: | |
| - id: debug | |
| name: Print environment variables and event payload | |
| uses: hmarr/debug-action@v3.0.0 | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| ref: ${{ env.REF }} | |
| - id: version | |
| name: Get release version | |
| run: echo "result=$(jq .version package.json -r)" >>$GITHUB_OUTPUT | |
| - id: tag-prefix | |
| name: Get release tag prefix | |
| run: echo "result=$(jq .tagprefix grease.config.json -r)" >>$GITHUB_OUTPUT | |
| - id: tag | |
| name: Get release tag | |
| run: | | |
| echo "result=${{ format('{0}{1}', steps.tag-prefix.outputs.result, steps.version.outputs.result) }}" >>$GITHUB_OUTPUT | |
| - id: dist-tag | |
| name: Get dist tag | |
| uses: flex-development/dist-tag-action@1.1.2 | |
| with: | |
| target: ${{ steps.version.outputs.result }} | |
| publish: | |
| needs: preflight | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: release | |
| url: | | |
| ${{ format('{0}/{1}/releases/tag/{2}', github.server_url, github.repository, needs.preflight.outputs.tag) }} | |
| env: | |
| NOTES_FILE: RELEASE_NOTES.md | |
| steps: | |
| - id: bot-token | |
| name: Get bot token | |
| uses: actions/create-github-app-token@v3.1.1 | |
| with: | |
| app-id: ${{ secrets.BOT_APP_ID }} | |
| private-key: ${{ secrets.BOT_PRIVATE_KEY }} | |
| - id: github-token | |
| name: Set env.GITHUB_TOKEN | |
| run: echo "GITHUB_TOKEN=${{ steps.bot-token.outputs.token }}" >>$GITHUB_ENV | |
| - id: checkout | |
| name: Checkout ${{ env.REF_NAME }} | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| ref: ${{ env.REF }} | |
| token: ${{ steps.bot-token.outputs.token }} | |
| - id: gpg-import | |
| name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v7.0.0 | |
| with: | |
| git_config_global: true | |
| git_push_gpgsign: false | |
| git_tag_gpgsign: true | |
| git_user_signingkey: true | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| trust_level: 5 | |
| - id: bun | |
| name: Setup Bun | |
| uses: oven-sh/setup-bun@v2.2.0 | |
| with: | |
| bun-version-file: package.json | |
| - id: dependencies | |
| name: Install dependencies | |
| env: | |
| HUSKY: 0 | |
| run: bun install | |
| - id: pack | |
| name: Pack project | |
| run: bun pm pack | |
| - id: release-notes | |
| name: Generate release notes | |
| env: | |
| TZ: ${{ vars.TZ }} | |
| run: grease changelog -wo $NOTES_FILE && echo "$(cat $NOTES_FILE)" >>$GITHUB_STEP_SUMMARY | |
| - id: tag | |
| name: Create annotated tag | |
| run: 'grease tag -ps -m "release: {tag}" ${{ needs.preflight.outputs.version }}' | |
| - id: publish | |
| name: Publish release | |
| env: | |
| PRERELEASE: ${{ needs.preflight.outputs.prerelease }} | |
| TAG: ${{ needs.preflight.outputs.tag }} | |
| run: | | |
| gh release create $TAG *.tgz --title=$TAG --notes-file=$NOTES_FILE --verify-tag --prerelease=$PRERELEASE --discussion-category=releases |