Release #270
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: | |
| permissions: | |
| contents: read | |
| jobs: | |
| create_release: | |
| name: Create Release | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Create GitHub App Token | |
| uses: actions/create-github-app-token@v2.2.0 | |
| id: app_token | |
| with: | |
| app-id: ${{ secrets.BOT_GH_APP_ID }} | |
| private-key: ${{ secrets.BOT_GH_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: | | |
| ${{ github.event.repository.name }} | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.app_token.outputs.token }} | |
| - name: Get GitHub App User ID | |
| id: get_user_id | |
| run: echo "user_id=$(gh api "/users/${{ steps.app_token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ steps.app_token.outputs.token }} | |
| - name: Set up Git | |
| run: | | |
| git config --global user.name '${{ steps.app_token.outputs.app-slug }}[bot]' | |
| git config --global user.email '${{ steps.get_user_id.outputs.user_id }}+${{ steps.app_token.outputs.app-slug }}[bot]@users.noreply.github.com' | |
| git config --global commit.gpgsign false | |
| git config --global commit.signoff true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 'lts/*' | |
| - name: Cache npm global packages | |
| uses: actions/cache@v4.3.0 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-npm-global-${{ hashFiles('**/release.yml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-npm-global- | |
| - name: Install semantic-release dependencies | |
| run: | | |
| npm install -g \ | |
| semantic-release@25.0.2 \ | |
| @semantic-release/commit-analyzer@13.0.1 \ | |
| @semantic-release/release-notes-generator@14.1.0 \ | |
| @semantic-release/changelog@6.0.3 \ | |
| @semantic-release/git@10.0.1 \ | |
| @semantic-release/github@11.0.6 \ | |
| conventional-changelog-conventionalcommits@9.1.0 \ | |
| conventional-changelog-cli@5.0.0 | |
| - name: Check for existing releases | |
| id: check_releases | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app_token.outputs.token }} | |
| run: | | |
| if [ -z "$(gh release list --limit 1)" ]; then | |
| echo "create_initial=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "create_initial=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create initial release | |
| if: steps.check_releases.outputs.create_initial == 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app_token.outputs.token }} | |
| run: | | |
| gh release create v0.1.0 --title "🚀 Version 0.1.0" --notes "Initial release" | |
| - name: Semantic Release | |
| if: steps.check_releases.outputs.create_initial == 'false' | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app_token.outputs.token }} | |
| run: | | |
| semantic-release |