forked from shadowwalker/next-pwa
-
Notifications
You must be signed in to change notification settings - Fork 27
54 lines (54 loc) · 1.52 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
54
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
strategy:
matrix:
node-version: ["18.x"]
pnpm-version: ["8.x"]
if: ${{ contains(github.event.head_commit.message, '[bump]') || contains(github.event.head_commit.message, '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: Update npm
run: npm i -g npm@9
- name: Install dependencies
run: pnpm install
- name: Publish to npm
uses: changesets/action@v1
with:
commit: "Publish packages"
title: "Publish packages"
publish: pnpm publish-packages
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}