-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.51 KB
/
lib-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
55
name: adog-hydra-lib-publish
on: [push]
jobs:
publish:
runs-on: ubuntu-latest
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_AUTOMATION_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- args: [--global, gulp, prettier, typescript]
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Configure NPM token
run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc
- run: pnpm install
# Conditional step based on branch name
- name: Create Release Pull Request
id: changesets-version
uses: changesets/action@v1
with:
version: |
pnpm generate-pr
env:
GITHUB_TOKEN: ${{ secrets.GH_AUTOMATION_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
if: github.ref != 'refs/heads/main'
- name: Publish packages
id: changesets-publish
uses: changesets/action@v1
with:
publish: |
pnpm publish-packages
env:
GITHUB_TOKEN: ${{ secrets.GH_AUTOMATION_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
if: github.ref == 'refs/heads/main'