-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add snapshot release workflow (#587)
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 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,43 @@ | ||
name: Publish (Snapshot) | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: "The npm tag to publish to" | ||
required: true | ||
|
||
jobs: | ||
publish_snapshot: | ||
name: Publish (Snapshot) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
with: | ||
persist-credentials: true # needed for git push | ||
|
||
- uses: ./.github/actions/setup-deps | ||
|
||
- name: version packages | ||
run: pnpm changeset version --snapshot ${{ inputs.tag }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: git commit | ||
run: | | ||
git config --global user.name 'Thinkmill Release Bot' | ||
git config --global user.email 'automation+github@thinkmill.com.au' | ||
git commit -a -m 'rc' | ||
- run: pnpm build:packages | ||
|
||
- name: npm publish, git tag | ||
run: pnpm changeset publish --tag ${{ inputs.tag }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
# reset, then push the dangling commit | ||
- name: git push | ||
run: | | ||
git reset HEAD~1 --hard | ||
git push origin --tags |