-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The workflow first updates the version in the package.json, commits that change and then runs `npm publish`. It is triggered by GitHub releases and can be manually dispatched.
- Loading branch information
Showing
1 changed file
with
31 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,31 @@ | ||
name: Publish to npm registry | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: true | ||
description: The version to release | ||
|
||
jobs: | ||
btp: | ||
runs-on: ubuntu-latest | ||
name: Publish | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Bump version | ||
run: |- | ||
cat <<< $(jq '.version = (env.RELEASE_VERSION | sub("(^refs/tags/v)|(^v)"; ""))' package.json) > package.json | ||
git config --local user.email "zepatrik@users.noreply.github.com" | ||
git config --local user.name "zepatrik" | ||
git add package.json | ||
git commit -m "autogen: bump version" | ||
git push -f "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:master | ||
env: | ||
RELEASE_VERSION: ${{ github.event.inputs.version || github.ref }} | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_AENEASR }} |