npm-publish #36
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
name: npm-publish | |
on: | |
workflow_dispatch: | |
inputs: | |
package-version: | |
description: Package version (empty = current tag) | |
default: 0.0.0 | |
type: string | |
jobs: | |
npm: | |
name: 'update npm package' | |
runs-on: ubuntu-latest | |
env: | |
PACKAGE_NAME: 'couper' | |
PACKAGE_VERSION: ${{ github.event.inputs.package-version || github.ref_name }} | |
# https://github.com/JS-DevTools/npm-publish/issues/15 | |
INPUT_TOKEN: '' | |
steps: | |
- name: 'checkout' | |
uses: actions/checkout@v2 | |
- name: 'prepare package' | |
run: | | |
cp LICENSE .npm | |
curl -L https://github.com/malud/temgo/releases/download/0.2.1/tg -o tg | |
chmod +x tg | |
PACKAGE_VERSION=${PACKAGE_VERSION#v} | |
./tg -i .npm/package.json | |
cat .npm/package.json | |
- name: 'setup node' | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: 'publish package' | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
package: ".npm/package.json" | |
access: "public" | |
token: ${{ secrets.NPM_TOKEN }} | |
- name: 'test published package' | |
run: | | |
cd $(mktemp -d) && npm install $PACKAGE_NAME && $(npm bin)/couper version |