@@ -10,59 +10,21 @@ jobs:
1010 install :
1111 runs-on : ubuntu-latest
1212 steps :
13- - uses : actions/checkout@v4
13+ - uses : actions/checkout@v6
1414 - uses : pnpm/action-setup@v4
15- - uses : actions/setup-node@v4.4.0
15+ - uses : actions/setup-node@v6
1616 with :
1717 node-version-file : .node-version
1818 cache : pnpm
1919 - run : pnpm install
2020
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
49- - uses : pnpm/action-setup@v4
50- - uses : actions/setup-node@v4.4.0
51- with :
52- node-version-file : .node-version
53- cache : pnpm
54- - run : pnpm install
55-
56- - name : Check
57- run : pnpm exec beachball check
58-
5921 test :
6022 needs : install
6123 runs-on : ubuntu-latest
6224 steps :
63- - uses : actions/checkout@v4
25+ - uses : actions/checkout@v6
6426 - uses : pnpm/action-setup@v4
65- - uses : actions/setup-node@v4.4.0
27+ - uses : actions/setup-node@v6
6628 with :
6729 node-version-file : .node-version
6830 cache : pnpm
@@ -77,40 +39,66 @@ jobs:
7739 - name : Test
7840 run : pnpm run test
7941
80- build :
81- if : ${{ always() && !failure() && !cancelled() }}
82- needs : [test, check-beachball-changefile]
42+ check-version-plan :
43+ needs : install
44+ if : github.base_ref == github.event.repository.default_branch && github.head_ref != 'release' && !startsWith(github.head_ref, 'renovate/')
8345 runs-on : ubuntu-latest
84- permissions :
85- id-token : write
86- contents : write
8746 steps :
88- - uses : actions/checkout@v4
89- - uses : pnpm/action-setup@v4
90- - uses : actions/setup-node@v4.4.0
47+ - name : Checkout
48+ uses : actions/checkout@v6
49+ with :
50+ fetch-depth : 0
51+
52+ - name : Prepare pnpm
53+ uses : pnpm/action-setup@v4
54+
55+ - name : Prepare Node.js
56+ uses : actions/setup-node@v6
9157 with :
9258 node-version-file : .node-version
9359 cache : pnpm
94- - run : pnpm install
9560
96- - name : Build
97- run : pnpm run build
61+ - name : Install dependencies
62+ run : pnpm install
9863
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
64+ - name : Set SHAs for Nx
65+ uses : nrwl/nx-set-shas@v4
66+
67+ - name : Check version plan
68+ run : pnpm exec nx release plan:check
69+
70+ check-renovate-version-plan :
71+ needs : install
72+ if : startsWith(github.event.pull_request.head.ref, 'renovate/') && github.base_ref == github.event.repository.default_branch
73+ uses : RightCapitalHQ/actions/.github/workflows/nx-release-auto-plan.yml@nx-release-auto-plan/v0.4.2
74+ secrets : inherit
11075
111- - name : Publish (main)
112- if : github.repository == 'RightCapitalHQ/phpdoc-parser' && github.ref_name == github.event.repository.default_branch
76+ prerelease :
77+ if : >-
78+ !failure() && !cancelled()
79+ && github.event_name == 'pull_request'
80+ && github.event.pull_request.head.repo.full_name == 'RightCapitalHQ/phpdoc-parser'
81+ && github.base_ref == github.event.repository.default_branch
82+ && github.head_ref != 'release'
83+ needs : [test, check-version-plan, check-renovate-version-plan]
84+ runs-on : ubuntu-latest
85+ steps :
86+ - uses : actions/create-github-app-token@v3
87+ id : app-token
88+ with :
89+ app-id : ${{ secrets.RC_BOT_APP_ID }}
90+ private-key : ${{ secrets.RC_BOT_PRIVATE_KEY }}
91+ permission-actions : write
92+ - name : Trigger prerelease workflow
93+ env :
94+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
95+ BRANCH_NAME : ${{ github.head_ref }}
96+ RUN_NUMBER : ${{ github.run_number }}
97+ RUN_ATTEMPT : ${{ github.run_attempt }}
11398 run : |
114- git config --local user.email "npm-publisher@rightcapital.com"
115- git config --local user.name "GitHub Actions[bot]"
116- pnpm beachball publish --access public --yes -m 'chore(release): applying package updates'
99+ gh workflow run release.yml \
100+ --repo "$GITHUB_REPOSITORY" \
101+ -f prerelease=true \
102+ -f "branch_name=${BRANCH_NAME}" \
103+ -f "run_number=${RUN_NUMBER}" \
104+ -f "run_attempt=${RUN_ATTEMPT}"
0 commit comments