99 install :
1010 runs-on : ubuntu-latest
1111 steps :
12- - uses : actions/checkout@v4
12+ - uses : actions/checkout@v6
1313 - uses : pnpm/action-setup@v4
14- - uses : actions/setup-node@v4
14+ - uses : actions/setup-node@v6
1515 with :
1616 node-version-file : .node-version
1717 cache : pnpm
2121 needs : install
2222 runs-on : ubuntu-latest
2323 steps :
24- - uses : actions/checkout@v4
24+ - uses : actions/checkout@v6
2525 - uses : pnpm/action-setup@v4
26- - uses : actions/setup-node@v4
26+ - uses : actions/setup-node@v6
2727 with :
2828 node-version-file : .node-version
2929 cache : pnpm
@@ -36,40 +36,77 @@ jobs:
3636 needs : install
3737 runs-on : ubuntu-latest
3838 steps :
39- - uses : actions/checkout@v4
39+ - uses : actions/checkout@v6
4040 - uses : docker://rhysd/actionlint:1.6.26
4141 with :
4242 args : -color
4343
44- publish :
45- if : ${{ always() && !failure() && !cancelled() }}
46- needs : [test, check-workflow-files]
44+ check-version-plan :
45+ needs : install
46+ if : github.base_ref == github.event.repository.default_branch && github.head_ref != 'release' && !startsWith(github.head_ref, 'renovate/')
4747 runs-on : ubuntu-latest
48- permissions :
49- id-token : write
50- contents : read
5148 steps :
52- - uses : actions/checkout@v4
53- - uses : pnpm/action-setup@v4
54- - uses : actions/setup-node@v4
49+ - name : Checkout
50+ uses : actions/checkout@v6
51+ with :
52+ fetch-depth : 0
53+
54+ - name : Prepare pnpm
55+ uses : pnpm/action-setup@v4
56+
57+ - name : Prepare Node.js
58+ uses : actions/setup-node@v6
5559 with :
5660 node-version-file : .node-version
5761 cache : pnpm
58- - run : pnpm install
59- - run : pnpm run build
6062
61- - name : Publish (development)
62- if : github.event.pull_request.head.repo.full_name == 'RightCapitalHQ/verdaccio-package-diff' && github.base_ref == github.event.repository.default_branch
63- env :
64- HEAD_REF : ${{ github.head_ref }}
65- run : |
66- preid="${HEAD_REF//\//-}".${{ github.run_number }}.${{ github.run_attempt }}
67- pnpm exec npm --no-git-tag-version version prerelease --preid="${preid}"
68- pnpm publish --no-git-checks --access public --tag development
63+ - name : Install dependencies
64+ run : pnpm install
6965
70- - name : Publish (main)
71- if : github.repository == 'RightCapitalHQ/verdaccio-package-diff' && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
66+ - name : Set SHAs for Nx
67+ uses : nrwl/nx-set-shas@v4
68+
69+ - name : Check version plan
70+ run : pnpm exec nx release plan:check
71+
72+ check-renovate-version-plan :
73+ needs : install
74+ if : startsWith(github.event.pull_request.head.ref, 'renovate/') && github.base_ref == github.event.repository.default_branch
75+ uses : RightCapitalHQ/actions/.github/workflows/nx-release-auto-plan.yml@nx-release-auto-plan/v0.4.2
76+ secrets : inherit
77+
78+ prerelease :
79+ if : >-
80+ !failure() && !cancelled()
81+ && github.event_name == 'pull_request'
82+ && github.event.pull_request.head.repo.full_name == 'RightCapitalHQ/verdaccio-package-diff'
83+ && github.base_ref == github.event.repository.default_branch
84+ && github.head_ref != 'release'
85+ needs :
86+ [
87+ test,
88+ check-version-plan,
89+ check-renovate-version-plan,
90+ check-workflow-files,
91+ ]
92+ runs-on : ubuntu-latest
93+ steps :
94+ - uses : actions/create-github-app-token@v3
95+ id : app-token
96+ with :
97+ app-id : ${{ secrets.RC_BOT_APP_ID }}
98+ private-key : ${{ secrets.RC_BOT_PRIVATE_KEY }}
99+ permission-actions : write
100+ - name : Trigger prerelease workflow
101+ env :
102+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
103+ BRANCH_NAME : ${{ github.head_ref }}
104+ RUN_NUMBER : ${{ github.run_number }}
105+ RUN_ATTEMPT : ${{ github.run_attempt }}
72106 run : |
73- git config --local user.email "npm-publisher@rightcapital.com"
74- git config --local user.name "GitHub Actions[bot]"
75- pnpm beachball publish --access public --yes -m 'chore(release): applying package updates'
107+ gh workflow run release.yml \
108+ --repo "$GITHUB_REPOSITORY" \
109+ -f prerelease=true \
110+ -f "branch_name=${BRANCH_NAME}" \
111+ -f "run_number=${RUN_NUMBER}" \
112+ -f "run_attempt=${RUN_ATTEMPT}"
0 commit comments