Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

chore(ci): perform a dry-run release on each PR #244

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
name: Publish crates

on:
# We only want to perform dry runs when this workflow runs on PRs.
pull_request:
branches: [master]
Comment on lines +5 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @TomAFrench called out, this will need to become pull_request_target before merge

workflow_dispatch:
inputs:
acvm-ref:
description: The acvm reference to checkout
required: true
publish:
description: Publish packages to crates.io
type: boolean
required: true

jobs:
publish:
name: Publish in order
runs-on: ubuntu-latest
env:
DRY_RUN_FLAG: ${{ (inputs.publish && '') || '--dry-run' }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
ref: ${{ inputs.acvm-ref }}
ref: ${{ inputs.acvm-ref || github.ref }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
Expand All @@ -25,30 +34,30 @@ jobs:
# These steps are in a specific order so crate dependencies are updated first
- name: Publish acir_field
run: |
cargo publish --package acir_field
cargo publish $DRY_RUN_FLAG --package acir_field
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish brillig_vm
run: |
cargo publish --package brillig_vm
cargo publish $DRY_RUN_FLAG --package brillig_vm
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish acir
run: |
cargo publish --package acir
cargo publish $DRY_RUN_FLAG --package acir
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish acvm_stdlib
run: |
cargo publish --package acvm_stdlib
cargo publish $DRY_RUN_FLAG --package acvm_stdlib
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish acvm
run: |
cargo publish --package acvm
cargo publish $DRY_RUN_FLAG --package acvm
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
with:
workflow: publish.yml
ref: master
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}", "publish": true }'
Loading