Skip to content

Commit 275cc30

Browse files
committed
Merge remote-tracking branch 'origin/master' into new-version-for-lib
# Conflicts: # .github/workflows/bump-version.yml # .github/workflows/ci.yml # .github/workflows/publish.yml
2 parents f65ca03 + 774d641 commit 275cc30

File tree

4 files changed

+54
-111
lines changed

4 files changed

+54
-111
lines changed

.github/actions/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'My composite action'
2+
description: 'Checks out the repository and install'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- uses: actions/checkout@v4
7+
with:
8+
fetch-depth: 0
9+
- name: Setup Node.js
10+
uses: actions/setup-node@v4
11+
with:
12+
node-version: 20
13+
- name: Restore cached npm dependencies
14+
id: cache-dependencies-restore
15+
uses: actions/cache/restore@v4
16+
with:
17+
path: |
18+
node_modules
19+
~/.cache/Cypress # needed for the Cypress binary
20+
key: ${{ runner.os }}npm-dependencies-${{ hashFiles('package-lock.json') }}
21+
- name: Npm install
22+
run: npm ci
23+
shell: bash
24+
- name: Cache npm dependencies
25+
id: cache-dependencies-save
26+
uses: actions/cache/save@v4
27+
with:
28+
path: |
29+
node_modules
30+
~/.cache/Cypress # needed for the Cypress binary
31+
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }}
32+
- name: Derive appropriate SHAs for base and head for `nx affected` commands
33+
uses: nrwl/nx-set-shas@v4
34+
with:
35+
main-branch-name: "master"

.github/workflows/bump-version.yml

Lines changed: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
name: Bump-version
1+
name: Create Releases
22
on:
3-
pull_request:
4-
types:
5-
- closed
6-
branches:
7-
- main
3+
workflow_dispatch:
4+
85
jobs:
96
build-and-test:
107
name: "Build and test"
11-
if: ${{ github.event.pull_request.merged == true }}
128
runs-on: ubuntu-latest
139
permissions:
1410
contents: "read"
@@ -17,35 +13,12 @@ jobs:
1713
- uses: actions/checkout@v4
1814
with:
1915
fetch-depth: 0
20-
- name: Setup Node.js
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 20
24-
- name: Restore cached npm dependencies
25-
id: cache-dependencies-restore
26-
uses: actions/cache/restore@v4
27-
with:
28-
path: |
29-
node_modules
30-
~/.cache/Cypress # needed for the Cypress binary
31-
key: ${{ runner.os }}npm-dependencies-${{ hashFiles('package-lock.json') }}
32-
- run: npm ci
33-
- name: Cache npm dependencies
34-
id: cache-dependencies-save
35-
uses: actions/cache/save@v4
36-
with:
37-
path: |
38-
node_modules
39-
~/.cache/Cypress # needed for the Cypress binary
40-
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }}
41-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
42-
uses: nrwl/nx-set-shas@v4
43-
with:
44-
main-branch-name: "main"
16+
- name: Npm install
17+
uses: ./.github/actions
4518
- run: npx nx affected -t lint test build --parallel=3 --exclude='test-npm' --base=origin/main~1 --head=origin/main
46-
4719
# - run: npm nx affected -t e2e-ci --parallel=1
4820
# - run: npm nx affected -t deploy --no-agents
21+
4922
bump-version:
5023
name: "Bump version"
5124
needs:
@@ -65,27 +38,8 @@ jobs:
6538
uses: actions/setup-node@v4
6639
with:
6740
node-version: 20
68-
- name: Restore cached npm dependencies
69-
id: cache-dependencies-restore
70-
uses: actions/cache/restore@v4
71-
with:
72-
path: |
73-
node_modules
74-
~/.cache/Cypress # needed for the Cypress binary
75-
key: ${{ runner.os }}npm-dependencies-${{ hashFiles('package-lock.json') }}
76-
- run: npm ci
77-
- name: Cache npm dependencies
78-
id: cache-dependencies-save
79-
uses: actions/cache/save@v4
80-
with:
81-
path: |
82-
node_modules
83-
~/.cache/Cypress # needed for the Cypress binary
84-
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }}
85-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
86-
uses: nrwl/nx-set-shas@v4
87-
with:
88-
main-branch-name: "main"
41+
- name: Checkout and install
42+
uses: ./.github/actions
8943
- name: Bump version
9044
run: |
9145
git config user.name 'Alex H'

.github/workflows/ci.yml

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,14 @@ on:
77
- opened
88
- synchronize
99
jobs:
10-
main:
10+
run-test:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version: 20
20-
- name: Restore cached npm dependencies
21-
id: cache-dependencies-restore
22-
uses: actions/cache/restore@v4
23-
with:
24-
path: |
25-
node_modules
26-
~/.cache/Cypress # needed for the Cypress binary
27-
key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('package-lock.json') }}
28-
- run: npm ci
29-
- name: Cache npm dependencies
30-
id: cache-dependencies-save
31-
uses: actions/cache/save@v4
32-
with:
33-
path: |
34-
node_modules
35-
~/.cache/Cypress # needed for the Cypress binary
36-
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }}
37-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
38-
uses: nrwl/nx-set-shas@v4
39-
with:
40-
main-branch-name: "main"
16+
- name: Npm install
17+
uses: ./.github/actions
4118
# This line is needed for nx affected to work when CI is running on a PR
4219
- run: git branch --track main origin/main
4320
- run: npx nx affected -t lint test build --parallel=3 --exclude='test-npm'

.github/workflows/publish.yml

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ name: Publish
22

33
on:
44
workflow_run:
5-
workflows: [ "Bump-version" ]
5+
workflows: [ "Create Releases" ]
66
types:
77
- completed
8+
env:
9+
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
10+
NPM_CONFIG_PROVENANCE: true
811

912
jobs:
10-
test:
13+
publish:
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1115
name: Publish
1216
runs-on: ubuntu-latest
1317
permissions:
@@ -19,36 +23,9 @@ jobs:
1923
- uses: actions/checkout@v4
2024
with:
2125
fetch-depth: 0
22-
- name: Setup Node.js
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: 20
26-
registry-url: https://registry.npmjs.org/
27-
- name: Restore cached npm dependencies
28-
id: cache-dependencies-restore
29-
uses: actions/cache/restore@v4
30-
with:
31-
path: |
32-
node_modules
33-
~/.cache/Cypress # needed for the Cypress binary
34-
key: ${{ runner.os }}npm-dependencies-${{ hashFiles('package-lock.json') }}
35-
- run: npm ci
36-
- name: Cache npm dependencies
37-
id: cache-dependencies-save
38-
uses: actions/cache/save@v4
39-
with:
40-
path: |
41-
node_modules
42-
~/.cache/Cypress # needed for the Cypress binary
43-
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }}
44-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
45-
uses: nrwl/nx-set-shas@v4
46-
with:
47-
main-branch-name: "main"
26+
- name: Npm install
27+
uses: ./.github/actions
4828
- run: npx nx affected -t build --parallel=3 --exclude='test-npm' --base=origin/main~1 --head=origin/main
4929
- name: Publish packages
5030
run: npx nx release publish
5131
shell: bash
52-
env:
53-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
54-
NPM_CONFIG_PROVENANCE: true

0 commit comments

Comments
 (0)