Skip to content

Commit

Permalink
Merge pull request #257 from kitsuyui/release-ci
Browse files Browse the repository at this point in the history
npm release flow (GitHub Actions)
  • Loading branch information
kitsuyui authored Aug 9, 2022
2 parents 00b91b2 + d9c5b8d commit 6f25764
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
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 }}

0 comments on commit 6f25764

Please sign in to comment.