-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from kitsuyui/release-ci
npm release flow (GitHub Actions)
- Loading branch information
Showing
1 changed file
with
48 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,48 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
release: | ||
# "released" events are emitted either when directly be released or be edited from pre-released. | ||
types: [prereleased, released] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: yarn | ||
cache-dependency-path: yarn.lock | ||
|
||
- name: install and build | ||
run: | | ||
yarn install | ||
yarn build | ||
- name: update version | ||
if: github.event_name == 'release' | ||
run: | | ||
npm version from-git --allow-same-version | ||
- run: npm pack | ||
|
||
- name: Test installation | ||
run: | | ||
set -eu | ||
built_dir=$(pwd) | ||
tempdir=$(mktemp -d) | ||
cd $tempdir | ||
yarn add $built_dir/*.tgz | ||
yarn run rendering-proxy --help | ||
cd $built_dir | ||
rm -rf $tempdir | ||
- run: npm publish | ||
if: github.event_name == 'release' && !github.event.release.prerelease | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |