-
Notifications
You must be signed in to change notification settings - Fork 11
55 lines (51 loc) · 1.27 KB
/
publish-camp.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
55
name: Publish (Camp)
defaults:
run:
working-directory: packages/camp
on:
push:
branches:
- alpha
- beta
- latest
permissions:
id-token: write
packages: write
jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
camp: ${{ steps.filter.outputs.camp }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
camp:
- packages/camp/**
publish:
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.camp == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: 'npm'
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish --tag ${{ github.ref_name }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
registry-url: "https://npm.pkg.github.com/"
- run: npm publish --tag ${{ github.ref_name }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}