sandbox/.github/workflows/npm-pub.yml
Yongmin Hong 4e98e27115
CI(typescript): add typescript stuff
Summary:
Add them as `package.json` deps. Also remove `--fund=false` in
GitHub Actions workflows where it's obsoleted by `.npmrc` file.

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

Test Plan: `npm ci`.

Reviewers: O1 revi & automations, revi

Reviewed By: O1 revi & automations, revi

Differential Revision: https://issuetracker.revi.xyz/D429
2024-06-25 17:20:02 +09:00

59 lines
1.6 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
# Setup .npmrc file to publish to npm
- name: 'Setup node.js'
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: 'Install dependencies'
run: npm ci
- name: 'Publish to npm'
run: npm publish --provenance --access public
working-directory: './npm/eslint-config'
env:
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
# Setup .npmrc file to publish to npm
- name: 'Setup node.js'
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: 'Install dependencies'
run: npm ci
- name: 'Publish to npm'
run: npm publish --provenance --access public
working-directory: './npm/prettier-config'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}