-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 1.84 KB
/
publish-packages.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Package Publish
on:
push:
paths-ignore:
- ".github/**"
- ".husky/**"
- ".vscode/**"
- "docs/**"
branches:
- main
permissions:
contents: write
actions: write
jobs:
npm_publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: |
echo "Running npm install"
npm ci
- name: Setup Nx tasks
uses: nrwl/nx-set-shas@v4
- name: Run execution tasks
run: npm run validate
- name: Get last tag for comparision
id: gitTag
uses: ./.github/actions/git-tags
- name: Check for Affected Projects
id: checkForAffected
uses: 2coo/action-nx-affected@v2
with:
base: ${{ steps.gitTag.outputs.currentTag }}
- name: Publish Affected Projects
if: steps.checkForAffected.outputs.hasAffected == 'true'
uses: ./.github/actions/nx-publish
env:
NPM_AUTH_TOKEN: ${{secrets.npm_token}}
with:
affectedProjects: ${{ steps.checkForAffected.outputs.affected }}
- name: Create Tag
uses: ./.github/actions/tag-git
if: steps.checkForAffected.outputs.hasAffected == 'true'
with:
version: ${{ steps.gitTag.outputs.nextTag }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: steps.checkForAffected.outputs.hasAffected == 'true'
uses: dev-build-deploy/release-me@v0
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ steps.gitTag.outputs.nextTag }}
versioning: calver