Skip to content

chore: release CLI v1.3.0 (#418) #174

chore: release CLI v1.3.0 (#418)

chore: release CLI v1.3.0 (#418) #174

name: Publish Release
on:
push:
branches:
- main
jobs:
publish_release:
name: Publish Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
# Note: `prepare-release.yaml` sets this commit message
if: ${{ contains(github.event.head_commit.message, 'release core packages') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup-and-build
# sets steps.resolve-release-version.outputs.version
- uses: ./.github/actions/resolve-release-version
id: resolve-release-version
- name: Publish to npm
run: >
pnpm --recursive
--filter "!@tutorialkit/cli"
--filter "@tutorialkit/*"
exec pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create and push git tag
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git tag ${{ steps.resolve-release-version.outputs.version }}
git push origin ${{ steps.resolve-release-version.outputs.version }}
publish_docs:
name: Publish documentation
needs: [publish_release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup-and-build
- name: Build docs
run: pnpm run docs:build
- name: Deploy documentation
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: tutorialkit-docs-page
workingDirectory: 'docs/tutorialkit.dev'
directory: dist
prepare_cli_release:
name: Prepare Release for CLI
needs: [publish_release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup-and-build
# sets steps.resolve-release-version.outputs.version
- uses: ./.github/actions/resolve-release-version
id: resolve-release-version
- name: Bump version
run: >
pnpm --recursive
--filter @tutorialkit/cli
exec npm version --no-git-tag-version --allow-same-version ${{ steps.resolve-release-version.outputs.version }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c
with:
# Note: `publish-release.yaml` checks explicitly for this commit message
commit-message: 'chore: release CLI v${{ steps.resolve-release-version.outputs.version }}'
title: 'chore: release CLI v${{ steps.resolve-release-version.outputs.version }}'
body: 'Bump CLI to version ${{ steps.resolve-release-version.outputs.version }}.'
reviewers: SamVerschueren,d3lm,Nemikolh,AriPerkkio
branch: chore/release-cli-${{ steps.resolve-release-version.outputs.version }}
token: ${{ secrets.GITOPS_REPO_PAT }}
publish_release_CLI:
name: Publish Release CLI
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
# Note: commit message is set by prepare_cli_release above
if: ${{ contains(github.event.head_commit.message, 'release CLI') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup-and-build
- name: Update template's versions
working-directory: ./packages/cli
run: pnpm build-release
- name: Integration Tests
working-directory: ./integration
run: pnpm test
- name: Publish to npm
run: >
pnpm --recursive
--filter @tutorialkit/cli
exec pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}