Skip to content

Publish Package

Publish Package #21

Workflow file for this run

name: Publish Package
on:
workflow_dispatch: {}
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install deps
run: yarn install
- name: Typecheck
run: yarn typecheck
- name: Build
run: yarn build
- name: Determine Release version
id: get_version
run: |
release_version=$(cat package.json | jq -r '.version')
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- name: Pack npm package
run: npm pack
id: pack_npm
env:
PACKAGE_FILE: ${{ steps.get_version.outputs.RELEASE_VERSION }}.tgz
- name: Perform Github Release
uses: softprops/action-gh-release@v1
env:
FILE_PATTERN: "!(.github)"
with:
name: ${{ env.RELEASE_VERSION }}
tag_name: ${{ env.RELEASE_VERSION }}
generate_release_notes: true
files: ${{ env.PACKAGE_FILE }}
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{secrets.SIMON_NPM_AUTH_TOKEN}}
run: |
echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > ~/.npmrc
npm publish ${{ env.PACKAGE_FILE }}