-
Notifications
You must be signed in to change notification settings - Fork 10
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
Showing
2 changed files
with
60 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,57 @@ | ||
name: release | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- '.clang-format' | ||
- '.gitignore' | ||
- 'README.md' | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
type: choice | ||
description: Release type | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
default: patch | ||
|
||
jobs: | ||
release: | ||
runs-on: [ ubuntu-22.04 ] | ||
environment: prod | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Set git user | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'bot@nil.foundation' | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v3.6.0 | ||
with: | ||
registry-url: 'https://npm.pkg.github.com' | ||
|
||
- name: Update version in package.json | ||
run: | | ||
npm version patch -m "${{ inputs.release_type }} release %s" | ||
git status | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: ${{ github.event.pull_request.head.ref }} | ||
tags: true | ||
|
||
- name: Publish package on NPM | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_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