sandbox/.github/workflows/npm-pub.yml
Yongmin Hong 1c5bfa8702
CI(GitHub Actions): --no-git-checks
Summary:
```
ERR_PNPM_GIT_UNKNOWN_BRANCH  The Git HEAD may not attached to any branch, but your "publish-branch" is set to "master|main".
If you want to disable Git checks on publish, set the "git-checks" setting to "false", or run again with "--no-git-checks".
Error: Process completed with exit code 1.
```

Signed-off-by: Yongmin Hong <revi@omglol.email>

Test Plan: Land and push tag again.

Reviewers: O1 revi & automations, revi

Reviewed By: O1 revi & automations, revi

Differential Revision: https://issuetracker.revi.xyz/D636
2024-08-01 19:19:36 +09:00

65 lines
1.9 KiB
YAML

---
name: Publish Package to npmjs
on:
push:
tags:
- 'eslint-config@v*'
- 'prettier-config@v*'
jobs:
eslint-config:
name: 'Publish eslint-config to npm'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
if: contains(github.ref_name, 'eslint-config@')
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
# Setup .npmrc file to publish to npm
- name: 'Setup node.js'
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- name: 'Install dependencies'
run: pnpm install
- name: 'Publish to npm'
run: pnpm publish --provenance --access public --no-git-checks
working-directory: './npm/eslint-config'
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
prettier-config:
name: 'Publish prettier-config to npm'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
if: contains(github.ref_name, 'prettier-config@')
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
# Setup .npmrc file to publish to npm
- name: 'Setup node.js'
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- name: 'Install dependencies'
run: pnpm install
- name: 'Publish to npm'
run: pnpm publish --provenance --access public --no-git-checks
working-directory: './npm/prettier-config'
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}