Skip to content

Release

Release #30

Workflow file for this run

name: Release
on:
workflow_run:
workflows:
- Test
types:
- completed
permissions:
contents: read # Read access for the workflow
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: write # Write access to create releases and tags
id-token: write # Necessary for generating the ID token for authentication
steps:
- name: "Generate token"
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install # or 'bun install' if you're using Bun
- name: Set up GitHub Token
run: |
echo "GITHUB_TOKEN=${{ steps.generate_token.outputs.token }}" >> $GITHUB_ENV
- name: Run release
run: npm run release # or 'bun run release' if you're using Bun
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} # Pass token for authentication
- name: Push changes
run: git push --follow-tags # Push the new release and tags back to the repository
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} # Pass token for authentication