diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 552dfa4..c0ceb6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,13 @@ name: Build on: + workflow_call: + inputs: + upload-release: + description: 'The release to upload artifacts to, if any' + default: '' + required: false + type: string workflow_dispatch: jobs: @@ -24,3 +31,10 @@ jobs: with: name: apcacli path: bin/apcacli + - if: ${{ inputs.upload-release != '' }} + name: Upload release asset + env: + GH_TOKEN: ${{ github.token }} + run: | + mv bin/apcacli apcacli + gh release upload ${{ inputs.upload-release }} apcacli diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4cc9c88..6b8ca5a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -64,3 +64,9 @@ jobs: run: cargo publish --no-verify --token "${CARGO_REGISTRY_TOKEN}" env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + build-artifacts: + needs: [publish, version] + uses: ./.github/workflows/build.yml + secrets: inherit + with: + upload-release: v${{ needs.version.outputs.version }}