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