-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cddfde9
commit df1bca6
Showing
12 changed files
with
345 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Resolve version | ||
description: Read "version" of "@tutorialkit/astro" to "steps.resolve-release-version.outputs.version" | ||
|
||
outputs: | ||
version: | ||
description: 'Version of @tutorialkit/astro' | ||
value: ${{ steps.resolve-release-version.outputs.version }} | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Resolve release version | ||
id: resolve-release-version | ||
shell: bash | ||
run: > | ||
echo "$( | ||
node -e " | ||
const fs = require('fs'); | ||
const pkg = fs.readFileSync('./packages/astro/package.json', 'utf8'); | ||
const version = JSON.parse(pkg).version | ||
console.log('version=' + version); | ||
" | ||
)" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Integration Tests CLI | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
cli-integration-test: | ||
name: CLI Integration Tests | ||
# Note: `prepare-release.yaml` sets this commit message | ||
if: ${{ contains(github.event.pull_request.title, 'release tutorialkit CLI') }} | ||
runs-on: ubuntu-latest | ||
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 update-template | ||
|
||
- name: Integration Tests | ||
working-directory: ./integration | ||
run: pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Prepare release PR | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version to publish, e.g. 0.0.1' | ||
required: true | ||
default: '0.0.1' | ||
type: string | ||
|
||
jobs: | ||
prepare_release: | ||
name: Prepare release PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/setup-and-build | ||
|
||
- name: Bump versions | ||
run: > | ||
pnpm --recursive | ||
--filter "@tutorialkit/*" | ||
--filter create-tutorial | ||
exec pnpm version --no-git-tag-version --allow-same-version ${{ inputs.version }} | ||
- name: Generage changelog | ||
run: | | ||
pnpm run changelog | ||
git checkout ./packages/cli | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
# Note: `publish-release.yaml` checks explicitly for this commit message | ||
commit-message: 'chore: release @tutorialkit packages and create-tutorial, version: ${{ inputs.version }}' | ||
title: 'chore: release @tutorialkit packages and create-tutorial, version: ${{ inputs.version }}' | ||
body: 'Bump packages to version ${{ inputs.version }} and generate changelogs' | ||
reviewers: SamVerschueren,d3lm,Nemikolh,AriPerkkio | ||
branch: chore/release-${{ inputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
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 @tutorialkit 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/*" | ||
--filter create-tutorial | ||
exec pnpm publish --provenance | ||
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 v${{ steps.resolve-release-version.outputs.version }} | ||
git push origin v${{ steps.resolve-release-version.outputs.version }} | ||
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 | ||
exec npm version --no-git-tag-version --allow-same-version ${{ steps.resolve-release-version.outputs.version }} | ||
- name: Generage changelog | ||
run: | | ||
pnpm run changelog | ||
git add ./packages/cli ./packages/template | ||
git checkout ./packages | ||
git checkout CHANGELOG.md | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
# Note: `publish-release.yaml` checks explicitly for this commit message | ||
commit-message: 'chore: release tutorialkit CLI, version: ${{ steps.resolve-release-version.outputs.version }}' | ||
title: 'chore: release tutorialkit CLI, version: ${{ steps.resolve-release-version.outputs.version }}' | ||
body: 'Bump tutorialkit CLI to version ${{ steps.resolve-release-version.outputs.version }} and generate changelog' | ||
reviewers: SamVerschueren,d3lm,Nemikolh,AriPerkkio | ||
branch: chore/release-cli-${{ steps.resolve-release-version.outputs.version }} | ||
|
||
publish_release_CLI: | ||
name: Publish release CLI | ||
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 tutorialkit 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 update-template | ||
|
||
- name: Integration Tests | ||
working-directory: ./integration | ||
run: pnpm test | ||
|
||
- name: Publish to npm | ||
run: pnpm --recursive --filter tutorialkit exec pnpm publish --provenance | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.