This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
109 lines (90 loc) · 3.2 KB
/
release-libs.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: release libs to github npm packages
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'libs/hooks/**'
- 'libs/blocks/**'
- 'libs/components/**'
- 'libs/providers/**'
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
packages: write
jobs:
build:
name: Build and Publish Libs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Setup Git
run: |
git config user.name "prince-deriv"
git config user.email "[email protected]"
- name: Install dependencies
run: npm ci
- uses: marceloprado/has-changed-path@df1b7a3161b8fb9fd8c90403c66a9e66dfde50cb
id: changed-hooks
with:
paths: libs/hooks
- uses: marceloprado/has-changed-path@df1b7a3161b8fb9fd8c90403c66a9e66dfde50cb
id: changed-providers
with:
paths: libs/providers
- uses: marceloprado/has-changed-path@df1b7a3161b8fb9fd8c90403c66a9e66dfde50cb
id: changed-components
with:
paths: libs/components
- uses: marceloprado/has-changed-path@df1b7a3161b8fb9fd8c90403c66a9e66dfde50cb
id: changed-blocks
with:
paths: libs/blocks
- name: Bump version Hooks
if: steps.changed-hooks.outputs.changed == 'true'
shell: bash
run: npx nx run hooks:version --skip-nx-cache
- name: Bump version Blocks
if: steps.changed-blocks.outputs.changed == 'true'
shell: bash
run: npx nx run blocks:version --skip-nx-cache
- name: Bump version Components
if: steps.changed-components.outputs.changed == 'true'
shell: bash
run: npx nx run components:version --skip-nx-cache
- name: Bump version Providers
if: steps.changed-providers.outputs.changed == 'true'
shell: bash
run: npx nx run providers:version --skip-nx-cache
- name: Create npmrc file
shell: bash
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.PUBLISH_NPM_TOKEN }}' > .npmrc
- name: Publish Hooks
if: steps.changed-hooks.outputs.changed == 'true'
shell: bash
run: npx nx run hooks:deploy --skip-nx-cache
- name: Publish Blocks
if: steps.changed-blocks.outputs.changed == 'true'
shell: bash
run: npx nx run blocks:deploy --skip-nx-cache
- name: Publish Components
if: steps.changed-components.outputs.changed == 'true'
shell: bash
run: npx nx run components:deploy --skip-nx-cache
- name: Publish Providers
if: steps.changed-providers.outputs.changed == 'true'
shell: bash
run: npx nx run providers:deploy --skip-nx-cache
- name: Push Tags and Commits
shell: bash
run: git push origin main --follow-tags