Skip to content

Release

Release #901

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:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_WORKFLOW_PUBLISH }}
- uses: ./.github/actions/node
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
- run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
shell: bash
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- 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 whoami
pnpm release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN_WORKFLOW_PUBLISH }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}