Skip to content

Publish

Publish #61

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
tag:
description: 'The npm tag to publish to'
required: true
type: choice
options:
- latest
- rc
permissions:
id-token: write
contents: write
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
timeout-minutes: 10
environment: Release
steps:
- uses: actions/checkout@main
with:
persist-credentials: true # needed for git push
- uses: ./.github/actions/ci-setup
- name: git config
run: |
git config --global user.name 'Keystonejs Release Bot'
git config --global user.email 'automation+keystonejs@thinkmill.com.au'
- name: version packages
if: inputs.tag != 'latest'
run: |
pnpm changeset version --snapshot ${{ inputs.tag }}
git commit -a -m 'rc'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm build
- name: npm publish, git tag
run: pnpm changeset publish --tag ${{ inputs.tag }}
# reset, then we have a tagged dangling commit
- name: git push
if: inputs.tag != 'latest'
run: |
git reset HEAD~1 --hard
- run: git push origin --tags