Skip to content

Commit

Permalink
ci: formalize dry-run option
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Feb 9, 2024
1 parent 9e918d7 commit 54281b3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/actions/node-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
npm-registry-token:
description: token to authenticate to npmjs.org
required: true
dry-run:
description: Whether to run npm publish in dry-run mode
required: false
default: 'true'

runs:
using: 'composite'
Expand All @@ -23,10 +27,18 @@ runs:
npm install
npm run build
- name: Publish dry run
if: inputs.dry-run == true
working-directory: codegen/node
shell: bash
run: |
npm publish --dry-run
- name: Publish to npm
if: inputs.dry-run == false
working-directory: codegen/node
shell: bash
env:
NPM_REGISTRY_TOKEN: ${{ inputs.npm-registry-token }}
run: |
npm publish --dry-run
npm publish
14 changes: 13 additions & 1 deletion .github/actions/rust-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
cargo-registry-token:
description: token to authenticate to crates.io
required: true
dry-run:
description: Whether to run npm publish in dry-run mode
required: false
default: 'true'

runs:
using: 'composite'
Expand All @@ -16,10 +20,18 @@ runs:
override: true
profile: minimal

- name: Publish dry run
if: inputs.dry-run == true
working-directory: codegen/rust
shell: bash
run: |
cargo publish --dry-run --allow-dirty
- name: Publish to Crates.io
if: inputs.dry-run == false
working-directory: codegen/rust
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ inputs.cargo-registry-token }}
run: |
cargo publish --dry-run --allow-dirty
cargo publish --allow-dirty
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- uses: ./.github/actions/rust-release
with:
cargo-registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
dry-run: true

node-release:
needs: [generate]
Expand All @@ -46,3 +47,4 @@ jobs:
- uses: ./.github/actions/node-release
with:
npm-registry-token: ${{ secrets.NPM_REGISTRY_TOKEN }}
dry-run: true

0 comments on commit 54281b3

Please sign in to comment.