-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: abstract release publishing into a composite action
- Loading branch information
Showing
3 changed files
with
64 additions
and
35 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,39 @@ | ||
name: "Publish Release" | ||
description: "Publishes a release to Github and npm" | ||
|
||
inputs: | ||
branchName: | ||
description: 'The branch name of from which this release was triggered' | ||
required: false | ||
default: 'latest' | ||
githubToken: | ||
description: 'The Github auth token' | ||
required: false | ||
default: 'latest' | ||
npmToken: | ||
description: 'The npm auth token' | ||
required: false | ||
default: 'latest' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Project | ||
uses: ./setup | ||
|
||
- name: Build Project | ||
run: npm run build | ||
|
||
- name: Semantic Release | ||
run: npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.githubToken }} | ||
|
||
- name: Publish to npm | ||
run: npm publish ./dist/*.tgz --tag ${{ inputs.tag }} | ||
NODE_AUTH_TOKEN: ${{ inputs.npmToken }} |
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,25 @@ | ||
name: Handle Release Branch Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'alpha' | ||
- 'beta' | ||
- 'main' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Project | ||
uses: ./.github/actions/publish-release | ||
with: | ||
branchName: ${{ github.head_ref || github.ref_name }} | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
npmToken: ${{ secrets.NPM_TOKEN }} |
This file was deleted.
Oops, something went wrong.