Skip to content

Commit 5073739

Browse files
committed
ci: create simpler action flows and add oicd token on release
1 parent 8aa8b5d commit 5073739

2 files changed

Lines changed: 51 additions & 72 deletions

File tree

.github/workflows/ci.yml

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,71 +6,66 @@ on:
66
pull_request:
77

88
env:
9-
NX_CLOUD_DISTRIBUTED_EXECUTION: ${{ !contains(github.event.pull_request.user.login, 'dependabot') }}
109
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_TOKEN }}
1110

1211
jobs:
1312
main:
1413
runs-on: ubuntu-latest
15-
if: ${{ github.event_name != 'pull_request' }}
1614
steps:
17-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v6
1816
name: Checkout [main]
1917
with:
2018
fetch-depth: 0
21-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
22-
uses: nrwl/nx-set-shas@v1
19+
- name: Derive SHAs for base and head for `nx affected` commands
20+
uses: nrwl/nx-set-shas@v4
21+
22+
- name: Set SHAs
23+
shell: bash
24+
run: |
25+
echo "BASE: ${{ env.NX_BASE }}"
26+
echo "HEAD: ${{ env.NX_HEAD }}"
27+
2328
- uses: actions/setup-node@v1
2429
with:
25-
node-version: 18.x
30+
node-version: 24.x
2631
- name: Install pnpm
2732
run: npm i -g pnpm
2833
- name: Install deps
2934
run: pnpm i --frozen-lockfile=false
3035
- name: Build Projects
31-
run: pnpm nx affected --target=build --parallel --max-parallel=3
36+
run: pnpm nx affected --target=build --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
3237
- name: Test Projects
33-
run: pnpm nx affected --target=test --parallel --max-parallel=2
34-
- run: pnpm nx-cloud stop-all-agents
38+
run: pnpm nx affected --target=test --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
3539
- name: Tag main branch if all jobs succeed
3640
uses: nrwl/nx-tag-successful-ci-run@v1
37-
pr:
38-
runs-on: ubuntu-latest
39-
if: ${{ github.event_name == 'pull_request' }}
40-
steps:
41-
- uses: actions/checkout@v2
42-
with:
43-
ref: ${{ github.event.pull_request.head.ref }}
44-
fetch-depth: 0
45-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
46-
uses: nrwl/nx-set-shas@v1
47-
- uses: actions/setup-node@v1
48-
with:
49-
node-version: 18.x
50-
- name: Install pnpm
51-
run: npm i -g pnpm
52-
- name: Install deps
53-
run: pnpm i --frozen-lockfile=false
54-
- name: Build Projects
55-
run: pnpm nx affected --target=build --parallel --max-parallel=3
56-
- name: Test Projects
57-
run: pnpm nx affected --target=test --parallel --max-parallel=2
58-
- run: pnpm nx-cloud stop-all-agents
59-
agents:
60-
runs-on: ubuntu-latest
61-
name: Agent 1
62-
timeout-minutes: 60
63-
strategy:
64-
matrix:
65-
agent: [ 1, 2, 3 ]
66-
steps:
67-
- uses: actions/checkout@v2
68-
- uses: actions/setup-node@v1
69-
with:
70-
node-version: 18.x
71-
- name: Install pnpm
72-
run: npm i -g pnpm
73-
- name: Install deps
74-
run: pnpm i --frozen-lockfile=false
75-
- name: Start Nx Agent ${{ matrix.agent }}
76-
run: pnpm nx-cloud start-agent
41+
# pr:
42+
# runs-on: ubuntu-latest
43+
# if: ${{ github.event_name == 'pull_request' }}
44+
# steps:
45+
# - uses: actions/checkout@v6
46+
# name: Checkout [pr]
47+
# with:
48+
# repository: ${{ github.event.pull_request.head.repo }}
49+
# ref: ${{ github.event.pull_request.head.ref }}
50+
# fetch-depth: 0
51+
# - name: Derive SHAs for base and head for `nx affected` commands
52+
# uses: nrwl/nx-set-shas@v4
53+
54+
# - name: Set SHAs
55+
# shell: bash
56+
# run: |
57+
# echo "BASE: ${{ env.NX_BASE }}"
58+
# echo "HEAD: ${{ env.NX_HEAD }}"
59+
60+
# - uses: actions/setup-node@v1
61+
# with:
62+
# node-version: 24.x
63+
# - name: Install pnpm
64+
# run: npm i -g pnpm
65+
# - name: Install deps
66+
# run: pnpm i --frozen-lockfile=false
67+
# - name: Build Projects
68+
# run: pnpm nx affected --target=build --parallel --max-parallel=3
69+
# - name: Test Projects
70+
# run: pnpm nx affected --target=test --parallel --max-parallel=2
71+
# - run: pnpm nx-cloud stop-all-agents

.github/workflows/release.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
env:
9-
NX_CLOUD_DISTRIBUTED_EXECUTION: true
1013
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_TOKEN }}
1114

1215
jobs:
@@ -20,10 +23,10 @@ jobs:
2023
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2124
fetch-depth: 0
2225

23-
- name: Setup Node.js 18.x
26+
- name: Setup Node.js 24.x
2427
uses: actions/setup-node@v1
2528
with:
26-
node-version: 18.x
29+
node-version: 24.x
2730

2831
- name: Install pnpm
2932
run: npm i -g pnpm
@@ -44,24 +47,5 @@ jobs:
4447
publish: pnpm release
4548
env:
4649
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
48-
- run: pnpm nx-cloud stop-all-agents
50+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4951

50-
agents:
51-
runs-on: ubuntu-latest
52-
name: Agent 1
53-
timeout-minutes: 60
54-
strategy:
55-
matrix:
56-
agent: [ 1, 2, 3 ]
57-
steps:
58-
- uses: actions/checkout@v2
59-
- uses: actions/setup-node@v1
60-
with:
61-
node-version: 18.x
62-
- name: Install pnpm
63-
run: npm i -g pnpm
64-
- name: Install deps
65-
run: pnpm i --frozen-lockfile=false
66-
- name: Start Nx Agent ${{ matrix.agent }}
67-
run: pnpm nx-cloud start-agent

0 commit comments

Comments
 (0)