From b265920bc1b0c776d20326a0b74fc635c22af4b9 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Fri, 17 Feb 2023 14:35:46 -0700 Subject: [PATCH] feat(ci): Publish crates upon release (#104) --- .github/workflows/publish.yml | 48 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 13 ++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..052faf9ee --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,48 @@ +name: Publish crates + +on: + workflow_dispatch: + inputs: + acvm-ref: + description: The acvm reference to checkout + required: true + +jobs: + publish: + name: Publish in order + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + with: + ref: ${{ inputs.acvm-ref }} + + - name: Setup toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.66.0 + + # These steps are in a specific order so crate dependencies are updated first + - name: Publish acir_field + run: | + cargo publish --package acir_field + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }} + + - name: Publish acir + run: | + cargo publish --package acir + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }} + + - name: Publish acvm + run: | + cargo publish --package acvm + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }} + + - name: Publish acvm_stdlib + run: | + cargo publish --package acvm_stdlib + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 068ed7e1e..482795bf5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,3 +18,16 @@ jobs: uses: google-github-actions/release-please-action@v3 with: command: manifest + + publish: + name: Publish crates + needs: [release-please] + if: ${{ needs.release-please.outputs.tag-name }} + runs-on: ubuntu-latest + steps: + - name: Dispatch to publish workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: publish.yml + ref: master + inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'