66 branches : [main]
77 workflow_dispatch :
88
9+ permissions :
10+ contents : read
11+
912jobs :
1013 install :
1114 runs-on : ubuntu-latest
1215 steps :
13- - uses : actions/checkout@v4
14- - uses : pnpm/action-setup@v4
15- 16- with :
17- node-version-file : .node-version
18- cache : pnpm
19- - run : pnpm install
20-
21- check-renovate-changefile :
22- if : startsWith(github.event.pull_request.head.ref, 'renovate/') && github.base_ref == github.event.repository.default_branch
23- needs : install
24- runs-on : ubuntu-latest
25- steps :
26- - uses : actions/checkout@v4
27- with :
28- ref : ${{ github.event.pull_request.head.ref }}
29- token : ${{ secrets.RENOVATE_AUTO_BEACHBALL_CHANGEFILE_TOKEN }}
30-
31- # Install dependencies (example using pnpm)
32- - uses : pnpm/action-setup@v4
33- - uses : actions/setup-node@v4
34- with :
35- node-version-file : .node-version
36- cache : pnpm
37- - run : pnpm install
38-
39- - name : Check and generate changefile for Renovate
40- # Pin to the last commit on main before this action was removed (replaced by renovate-auto-version-plan)
41- uses : RightCapitalHQ/frontend-style-guide/.github/actions/renovate-auto-beachball-changefile@e7e6cdd89b0a5e56bb7b1b5280aae241d9e4e848
42-
43- check-beachball-changefile :
44- if : github.base_ref == github.event.repository.default_branch
45- needs : install
46- runs-on : ubuntu-latest
47- steps :
48- - uses : actions/checkout@v4
16+ - uses : actions/checkout@v6
4917 - uses : pnpm/action-setup@v4
50- - uses : actions/setup-node@v4.4.0
18+ - uses : actions/setup-node@v6
5119 with :
5220 node-version-file : .node-version
5321 cache : pnpm
5422 - run : pnpm install
5523
56- - name : Check
57- run : pnpm exec beachball check
58-
5924 test :
6025 needs : install
6126 runs-on : ubuntu-latest
6227 steps :
63- - uses : actions/checkout@v4
28+ - uses : actions/checkout@v6
6429 - uses : pnpm/action-setup@v4
65- - uses : actions/setup-node@v4.4.0
30+ - uses : actions/setup-node@v6
6631 with :
6732 node-version-file : .node-version
6833 cache : pnpm
@@ -77,40 +42,66 @@ jobs:
7742 - name : Test
7843 run : pnpm run test
7944
80- build :
81- if : ${{ always() && !failure() && !cancelled() }}
82- needs : [test, check-beachball-changefile]
45+ check-version-plan :
46+ needs : install
47+ if : github.base_ref == github.event.repository.default_branch && github.head_ref != 'release' && !startsWith(github.head_ref, 'renovate/')
8348 runs-on : ubuntu-latest
84- permissions :
85- id-token : write
86- contents : write
8749 steps :
88- - uses : actions/checkout@v4
89- - uses : pnpm/action-setup@v4
90- 50+ - name : Checkout
51+ uses : actions/checkout@v6
52+ with :
53+ fetch-depth : 0
54+
55+ - name : Prepare pnpm
56+ uses : pnpm/action-setup@v4
57+
58+ - name : Prepare Node.js
59+ uses : actions/setup-node@v6
9160 with :
9261 node-version-file : .node-version
9362 cache : pnpm
94- - run : pnpm install
9563
96- - name : Build
97- run : pnpm run build
64+ - name : Install dependencies
65+ run : pnpm install
9866
99- - name : Publish (development)
100- if : >-
101- github.repository == 'RightCapitalHQ/phpdoc-parser' &&
102- (github.base_ref == github.event.repository.default_branch ||
103- (github.event_name == 'workflow_dispatch' && github.ref_name != github.event.repository.default_branch))
104- env :
105- HEAD_REF : ${{ github.head_ref || github.ref_name }}
106- run : |
107- preid="${HEAD_REF//\//-}".${{ github.run_number }}.${{ github.run_attempt }}
108- npm --no-git-tag-version version prerelease --preid="${preid}"
109- pnpm publish --no-git-checks --access public --tag development
67+ - name : Set SHAs for Nx
68+ uses : nrwl/nx-set-shas@v4
69+
70+ - name : Check version plan
71+ run : pnpm exec nx release plan:check
72+
73+ check-renovate-version-plan :
74+ needs : install
75+ if : startsWith(github.event.pull_request.head.ref, 'renovate/') && github.base_ref == github.event.repository.default_branch
76+ uses : RightCapitalHQ/actions/.github/workflows/nx-release-auto-plan.yml@nx-release-auto-plan/v0.4.2
77+ secrets : inherit
11078
111- - name : Publish (main)
112- if : github.repository == 'RightCapitalHQ/phpdoc-parser' && github.ref_name == github.event.repository.default_branch
79+ prerelease :
80+ if : >-
81+ !failure() && !cancelled()
82+ && github.event_name == 'pull_request'
83+ && github.event.pull_request.head.repo.full_name == 'RightCapitalHQ/phpdoc-parser'
84+ && github.base_ref == github.event.repository.default_branch
85+ && github.head_ref != 'release'
86+ needs : [test, check-version-plan, check-renovate-version-plan]
87+ runs-on : ubuntu-latest
88+ steps :
89+ - uses : actions/create-github-app-token@v3
90+ id : app-token
91+ with :
92+ app-id : ${{ secrets.RC_BOT_APP_ID }}
93+ private-key : ${{ secrets.RC_BOT_PRIVATE_KEY }}
94+ permission-actions : write
95+ - name : Trigger prerelease workflow
96+ env :
97+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
98+ BRANCH_NAME : ${{ github.head_ref }}
99+ RUN_NUMBER : ${{ github.run_number }}
100+ RUN_ATTEMPT : ${{ github.run_attempt }}
113101 run : |
114- git config --local user.email "[email protected] " 115- git config --local user.name "GitHub Actions[bot]"
116- pnpm beachball publish --access public --yes -m 'chore(release): applying package updates'
102+ gh workflow run release.yml \
103+ --repo "$GITHUB_REPOSITORY" \
104+ -f prerelease=true \
105+ -f "branch_name=${BRANCH_NAME}" \
106+ -f "run_number=${RUN_NUMBER}" \
107+ -f "run_attempt=${RUN_ATTEMPT}"
0 commit comments