forked from shadowwalker/next-pwa
-
Notifications
You must be signed in to change notification settings - Fork 27
53 lines (53 loc) · 1.55 KB
/
npm-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Publish packages to npm
on:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
jobs:
test:
name: ⬣, 🔎, 🔨 Test before releasing
uses: ./.github/workflows/build-and-test.yml
secrets: inherit
publish:
name: 🚀 Release packages
needs: [test]
runs-on: [ubuntu-latest]
permissions:
contents: write
id-token: write
pull-requests: write
strategy:
matrix:
node-version: ["20.x"]
pnpm-version: ["9.x"]
if: "${{ contains(github.event.head_commit.message, '[bump]') || contains(github.event.head_commit.message, 'chore(packages): publish packages') }}"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm-version }}
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Publish to npm
uses: changesets/action@v1
with:
commit: "chore(packages): publish packages"
title: "chore(packages): publish packages"
publish: pnpm publish-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}