Skip to content

Merge pull request from GHSA-jvmr-5fpx-r76j #167

Merge pull request from GHSA-jvmr-5fpx-r76j

Merge pull request from GHSA-jvmr-5fpx-r76j #167

Workflow file for this run

---
name: Build and Publish
on:
push:
branches:
- main
jobs:
test:
name: Build & Test
uses: ./.github/workflows/build-and-test.workflow.yml
publish:
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup env
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
# Publish to NPM
- name: Publish if version has been updated
uses: pascalgn/[email protected]
with:
tag_name: 'v%s'
tag_message: 'v%s'
commit_pattern: "^Release (\\S+)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.npm_token }}
# Publish to Github PKG
- uses: actions/setup-node@v3
with:
node-version: 14
registry-url: 'https://npm.pkg.github.com'
- name: Publish to Github PKG if version has been updated
uses: pascalgn/[email protected]
with:
create_tag: false
commit_pattern: "^Release (\\S+)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}