Skip to content

Commit b1f9199

Browse files
authored
Merge pull request #6 from photon-hq/ENG-613-support-dry-run
support npm and crates dry run publish
2 parents 98ba7b4 + 2956142 commit b1f9199

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

.github/actions/publish-npm/action.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ inputs:
2222
description: "[string] NPM tag (e.g., 'latest', 'beta')"
2323
required: false
2424
default: 'latest'
25+
dry-run:
26+
description: "[boolean: 'true'/'false'] Run npm publish --dry-run instead of actual publish"
27+
required: false
28+
default: 'false'
2529
npm-token:
2630
description: 'NPM authentication token'
2731
required: true
@@ -53,4 +57,9 @@ runs:
5357
working-directory: ${{ inputs.working-directory }}
5458
env:
5559
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
56-
run: npm publish --tag ${{ inputs.tag }} --access public
60+
run: |
61+
if [ "${{ inputs.dry-run }}" == "true" ]; then
62+
npm publish --tag ${{ inputs.tag }} --access public --dry-run
63+
else
64+
npm publish --tag ${{ inputs.tag }} --access public
65+
fi

.github/workflows/rust-service-release.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ on:
2020
type: boolean
2121
required: false
2222
default: false
23-
description: "Whether to create a prerelease (overrides label check if provided)"
23+
description: "Whether to create a prerelease"
2424
github-release:
2525
type: boolean
2626
required: false
2727
default: false
28-
description: "Whether to create a GitHub release (overrides label check if provided)"
28+
description: "Whether to create a GitHub release"
2929
build-env:
3030
type: string
3131
required: false
@@ -35,7 +35,12 @@ on:
3535
type: boolean
3636
required: false
3737
default: false
38-
description: "Whether to publish to crates.io (overrides label check if provided)"
38+
description: "Whether to publish to crates.io"
39+
dry-run:
40+
type: boolean
41+
required: false
42+
default: false
43+
description: "Run publish commands in dry-run mode (no actual publishing)"
3944
secrets:
4045
OPENAI_API_KEY:
4146
required: true
@@ -93,7 +98,6 @@ jobs:
9398
include:
9499
- target: x86_64-unknown-linux-gnu
95100
os: ubuntu-latest
96-
97101
- target: aarch64-apple-darwin
98102
os: macos-latest
99103
- target: x86_64-pc-windows-msvc
@@ -141,4 +145,5 @@ jobs:
141145
with:
142146
crate-name: ${{ inputs.binary-name }}
143147
crate-path: ${{ inputs.binary-path }}
148+
dry-run: ${{ inputs.dry-run }}
144149
cargo-registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/typescript-service-release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ on:
4242
required: false
4343
default: "bun run build"
4444
description: "Build command"
45+
dry-run:
46+
type: boolean
47+
required: false
48+
default: false
49+
description: "Run publish commands in dry-run mode (no actual publishing)"
4550
secrets:
4651
OPENAI_API_KEY:
4752
required: true
@@ -119,4 +124,5 @@ jobs:
119124
tag: ${{ (inputs.prerelease || needs.check-labels.outputs.has_prerelease == 'true') && 'beta' || inputs.npm-tag }}
120125
working-directory: ${{ inputs.working-directory }}
121126
build-command: ${{ inputs.build-command }}
127+
dry-run: ${{ inputs.dry-run }}
122128
npm-token: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)