Release #10
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: | |
| inputs: | |
| dry-run: | |
| description: "Dry run the release" | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| prepare: | |
| name: Determine next version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new-release-version: ${{ steps.semantic.outputs.new-release-version }} | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.GH_BOT_CLIENT_ID }} | |
| private-key: ${{ secrets.GH_BOT_PRIVATE_KEY }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "lts/*" | |
| - name: Install Modules | |
| run: | | |
| npm install \ | |
| @semantic-release/git \ | |
| @semantic-release/changelog \ | |
| @semantic-release/exec | |
| - name: Determine next version | |
| id: semantic | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: npx semantic-release --dry-run | |
| build: | |
| name: Build | |
| needs: prepare | |
| if: needs.prepare.outputs.new-release-version != '' | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| version: ${{ needs.prepare.outputs.new-release-version }} | |
| secrets: inherit | |
| release: | |
| name: Create Release | |
| needs: [prepare, build] | |
| if: inputs.dry-run != 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.GH_BOT_CLIENT_ID }} | |
| private-key: ${{ secrets.GH_BOT_PRIVATE_KEY }} | |
| - name: Get bot user ID | |
| id: bot-user-id | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10.6' | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: latest | |
| enable-cache: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "lts/*" | |
| - name: Install Modules | |
| run: | | |
| npm install -g rdme \ | |
| && npm install \ | |
| @semantic-release/git \ | |
| @semantic-release/changelog \ | |
| @semantic-release/exec \ | |
| @semantic-release/github | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: lumos-*-v${{ needs.prepare.outputs.new-release-version }} | |
| merge-multiple: true | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| RDME_API_KEY: ${{ secrets.RDME_API_KEY }} | |
| GIT_AUTHOR_EMAIL: "${{ steps.bot-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" | |
| GIT_COMMITTER_EMAIL: "${{ steps.bot-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" | |
| run: npx semantic-release | |
| release-homebrew: | |
| name: Release Homebrew Tap | |
| needs: [prepare, release] | |
| if: inputs.dry-run != 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.GH_BOT_CLIENT_ID }} | |
| private-key: ${{ secrets.GH_BOT_PRIVATE_KEY }} | |
| repositories: homebrew-tap | |
| - name: Trigger homebrew-tap release | |
| run: | | |
| curl -X POST \ | |
| -H "Authorization: token ${{ steps.app-token.outputs.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| https://api.github.com/repos/teamlumos/homebrew-tap/dispatches \ | |
| -d '{"event_type": "release", "client_payload": {"version": "${{ needs.prepare.outputs.new-release-version }}"}}' |