-
Notifications
You must be signed in to change notification settings - Fork 5
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
8dcb61f
commit a040c2c
Showing
5 changed files
with
85 additions
and
11 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
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,54 @@ | ||
name: Release Package | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
prerelease: | ||
description: 'Is this a prerelease?' | ||
required: false | ||
default: false | ||
type: boolean | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Release changed packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Yarn install | ||
run: yarn | ||
|
||
- name: Apply version to packages | ||
id: version-apply | ||
run: yarn version apply -all ${{ inputs.prerelease && '--prerelease' }} | ||
|
||
- name: Compute commit message | ||
uses: actions/github-script@v7 | ||
id: commit-message | ||
with: | ||
result-encoding: string | ||
script: | | ||
return `chore: release ${versions.map((v) => `${v.ident}@${v.newVersion}`)}`; | ||
# Commiting using the GitHub action bot | ||
# More info here: https://github.com/actions/checkout/issues/13#issuecomment-724415212 | ||
- name: Create commit of changed files | ||
run: | | ||
git add . | ||
git commit -m "${{ steps.commit-message.outputs.result }}" --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" | ||
git push | ||
- name: Publish changed packages | ||
run: yarn workspaces foreach -pt --since ${{ github.ref }} npm publish | ||
env: | ||
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
releases: | ||
"@typoas/cli": patch | ||
"@typoas/generator": patch |