Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publish to Github Packages

on:
workflow_dispatch:
inputs:
packageVersion:
description: "The version to publish (e.g. prerelease, patch, major, new-version 1.2.3)"
required: true
default: "prerelease"
distTag:
description: "The dist-tag to publish (e.g. latest, beta)"
required: true
default: "latest"

jobs:
authorize:
name: Authorize
runs-on: ubuntu-latest
steps:
- name: ${{ github.actor }} permission check to do a release
uses: "lannonbr/repo-permission-check-action@2.0.2"
with:
permission: "write"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
name: Publish to Github Packages
runs-on: ubuntu-latest
needs: [authorize]
env:
PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }}
DIST_TAG: ${{ github.event.inputs.distTag }}
strategy:
matrix:
node-version: [ 14.x ]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Lint
run: yarn lint

- name: Test
run: yarn test

- name: Set registry url
uses: actions/setup-node@v2
with:
registry-url: 'https://npm.pkg.github.com'

- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn publish --${{ env.PACKAGE_VERSION }} --tag ${{ env.DIST_TAG }} --no-git-tag-version