remove yarn (#507) #179
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: 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 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Setup env | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'pnpm' | |
- 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 }} |