Skip to content

Commit 232ee41

Browse files
committed
chore: fix-publish-steps
1 parent e239060 commit 232ee41

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/actions/publish-beta/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010

1111
- name: Run Builds
1212
shell: bash
13-
run: pnpm nx run-many -t build --no-agents
13+
run: pnpm nx run-many -t build --no-agents --skip-nx-cache
1414

1515
- name: Generate API Docs
1616
shell: bash

.github/actions/publish-release/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runs:
3232
3333
- name: Run Builds
3434
shell: bash
35-
run: pnpm nx run-many -t build --no-agents
35+
run: pnpm nx run-many -t build --no-agents --skip-nx-cache
3636

3737
- name: Generate API Docs
3838
shell: bash

.github/workflows/publish.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,17 @@ jobs:
9696
retention-days: 30
9797

9898
snapshot:
99-
if: ${{ github.event_name == 'workflow_dispatch' }}
99+
# Guard against publishing snapshots from the protected release branch.
100+
# Both github.ref (the branch selected in the UI) and inputs.branch (the
101+
# free-text checkout ref) must be checked, since they are independent values
102+
# and the checkout step uses inputs.branch directly.
103+
if: >-
104+
${{
105+
github.event_name == 'workflow_dispatch' &&
106+
github.ref != 'refs/heads/changeset-release/main' &&
107+
github.event.inputs.branch != 'changeset-release/main' &&
108+
github.event.inputs.branch != 'refs/heads/changeset-release/main'
109+
}}
100110
name: Publish Snapshots
101111
permissions:
102112
contents: write
@@ -123,6 +133,9 @@ jobs:
123133
env:
124134
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
125135

136+
- name: Build all packages (skip cache)
137+
run: pnpm nx run-many -t build --no-agents --skip-nx-cache
138+
126139
# The actual npm publish that must occur in the authorized file
127140
- name: Publish packages with dist-tag
128141
run: pnpm publish -r --tag ${{ inputs.dist_tag }} --no-git-checks --access ${{ inputs.access }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"scripts": {
1616
"build": "nx affected --target=build",
1717
"changeset": "changeset",
18-
"ci:release": "pnpm nx run-many -t build --no-agents && pnpm publish -r --no-git-checks && changeset tag",
18+
"ci:release": "pnpm nx run-many -t build --no-agents --skip-nx-cache && pnpm publish -r --no-git-checks && changeset tag",
1919
"ci:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm nx format:write --uncommitted",
2020
"circular-dep-check": "madge --circular .",
2121
"clean": "shx rm -rf ./{coverage,dist,docs,node_modules,tmp}/ ./{packages,e2e}/*/{dist,node_modules}/ ./e2e/node_modules/ && git clean -fX -e \"!.env*,nx-cloud.env\" -e \"!**/GEMINI.md\"",

0 commit comments

Comments
 (0)