Skip to content

Commit

Permalink
ci: separate create-tutorial releasing (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored Jul 17, 2024
1 parent bf9119e commit 5e36866
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 4 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/publish-create-tutorial.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Prepare create-tutorial Release PR

on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish, e.g. 0.0.1'
required: true
default: '0.0.1'
type: string
push:
branches:
- main
paths:
- 'packages/create-tutorial/package.json'

jobs:
prepare_release_create_tutorial:
name: Prepare Release PR
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/setup-and-build

- name: Bump versions
run: >
pnpm --recursive
--filter "create-tutorial"
exec pnpm version --no-git-tag-version --allow-same-version ${{ inputs.version }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c
with:
commit-message: 'chore: release `create-tutorial` v${{ inputs.version }}'
title: 'chore: release `create-tutorial` v${{ inputs.version }}'
body: 'Bump `create-tutorial` to version ${{ inputs.version }}.'
reviewers: SamVerschueren,d3lm,Nemikolh,AriPerkkio
branch: chore/release-create-tutorial-${{ inputs.version }}

publish_release_create_tutorial:
name: Publish Release create-tutorial
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
if: ${{ contains(github.event.head_commit.message, 'release `create-tutorial`') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/setup-and-build

- name: Publish to npm
run: >
pnpm --recursive
--filter create-tutorial
exec pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ jobs:
run: >
pnpm --recursive
--filter tutorialkit
--filter create-tutorial
exec npm version --no-git-tag-version --allow-same-version ${{ steps.resolve-release-version.outputs.version }}
- name: Create Pull Request
Expand Down Expand Up @@ -102,7 +101,6 @@ jobs:
run: >
pnpm --recursive
--filter tutorialkit
--filter create-tutorial
exec pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion packages/create-tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dist"
],
"dependencies": {
"tutorialkit": "workspace:*"
"tutorialkit": "latest"
},
"devDependencies": {
"@types/node": "^20.14.6",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5e36866

Please sign in to comment.