Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add publish to npm workflow #15

Merged
merged 1 commit into from
Nov 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
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 }}