Skip to content

Release

Release #1008

Workflow file for this run

name: Release
on:
workflow_dispatch:
permissions:
contents: write
id-token: write
concurrency:
group: Production
cancel-in-progress: false
env:
CI: true
DO_NOT_TRACK: '1'
jobs:
stable-version:
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
permissions:
id-token: write
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Authenticate
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
repositories: |
cosmo
permission-actions: write
permission-contents: write
permission-workflows: write
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- uses: ./.github/actions/node
- name: Install
run: pnpm install --frozen-lockfile
- name: Generate code
run: pnpm buf generate --template buf.ts.gen.yaml
- name: Check if git is not dirty after generating files
run: git diff --no-ext-diff --exit-code
# This will generate the next release in dry run mode, which still reads
# commits and bumps CHANGELOG.md and package.json files, but does not
# publish anything.
- name: Generate next version (dry-run)
run: pnpm lerna version --ignore-scripts --dry-run --yes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Build with the versions from the dry-run
- name: Build
run: pnpm run --filter='!./studio' build
# Reset dry-run changes to let publish do the real thing for the release
- name: Revert changes
run: git reset --hard
- name: Publish packages & Create Github Releases
run: |
git config --global user.email "bot@wundergraph.com"
git config --global user.name "hardworker-bot"
pnpm release
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}