-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(workflow): rework the release workflow
- Loading branch information
Showing
9 changed files
with
260 additions
and
259 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 |
---|---|---|
@@ -1,16 +1,11 @@ | ||
name: 'Release note' | ||
description: 'Create GitHub release with autogenerated notes (coming from the CHANGELOG)' | ||
|
||
inputs: | ||
versionTag: | ||
description: The version tag for the release | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const main = require('.github/actions/release-note/index.js'); | ||
await main({ versionTag: '${{ inputs.versionTag}}', context, github }); | ||
await main({ context, github }); |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: "Prepare Release Workflow" | ||
|
||
# Manual trigger workflow to automatically setup a new release PR (built & publish on merge) | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
description: 'Release type' | ||
required: true | ||
default: 'patch' | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref_name }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare_release: | ||
name: "Prepare Release" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITBOT_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: "Setup" | ||
uses: ./.github/actions/setup | ||
|
||
- name: "Increment package versions" | ||
id: version | ||
uses: ./.github/actions/increment-package-versions | ||
with: | ||
releaseType: '${{ inputs.releaseType }}' | ||
|
||
- name: "Check build libs" | ||
run: yarn build:libs | ||
|
||
- name: "Git commit & push" | ||
id: git | ||
run: | | ||
set -x # verbose | ||
git config --global user.name "lumbot" | ||
git config --global user.email "[email protected]" | ||
# Commit | ||
commit="chore(release): release v${{ steps.version.outputs.nextVersion }}" | ||
echo "commit=$commit" >> $GITHUB_OUTPUT | ||
git commit -am "$commit" | ||
# Push | ||
git push origin "${{ steps.version.outputs.releaseBranch }}" | ||
- name: "Create pull request" | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: '${{ secrets.GITBOT_TOKEN }}' | ||
script: | | ||
github.rest.pulls.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
base: 'master', | ||
head: '${{ steps.version.outputs.releaseBranch }}', | ||
title: '${{ steps.git.outputs.commit }}', | ||
body: '# Release v${{ steps.version.outputs.nextVersion }}\n\n' | ||
+ 'Review, test and merge to publish to NPM.\n\n' | ||
+ 'Triggered by @${{ github.actor }}', | ||
draft: false, | ||
}); |
Oops, something went wrong.