taiki-e / upload-rust-binary-action

GitHub Action for building and uploading Rust binary to GitHub Releases.
Apache License 2.0
227 stars 19 forks source link

Add outputs for the archive and checksum files #77

Closed matiaskorhonen closed 2 months ago

matiaskorhonen commented 2 months ago

Adds outputs from the action for the archive file name(s) and checksum file name(s).

This should enable using those in subsequent workflow steps, such as Artefact Attestations.

For example:

permissions:
  id-token: write
  contents: read
  attestations: write

#
# (the rest of the steps)
#

- uses: taiki-e/upload-rust-binary-action@v1
  id: upload-rust-binary-action
  with:
    dry-run: true
    bin: test-crate
    target: ${{ matrix.target }}
    build-tool: ${{ matrix.build_tool }}
    checksum: sha256,sha512,sha1,md5
    tar: all
    zip: all
    manifest-path: test-crate/Cargo.toml
    codesign: '-'

- name: Generate artifact attestation
  uses: actions/attest-build-provenance@v1
  with:
    subject-path: ${{ steps.upload-rust-binary-action.outputs.zip }}

# or

- name: Generate artifact attestation
  uses: actions/attest-build-provenance@v1
  with:
    subject-path: "${{ steps.upload-rust-binary-action.outputs.archive }}.*"

Hopefully I got most of the details right as I'm familiar with building GitHub Actions for the marketplace…

taiki-e commented 2 months ago

Thanks for the PR!

GITHUB_OUTPUT does not work on some self-hosted runners (https://github.com/taiki-e/create-gh-release-action/issues/17), so could you add a workaround for that problem (something like https://github.com/taiki-e/create-gh-release-action/commit/4466cb67b09ce43434d4955a48247d2af14993e6)?

Otherwise LGTM.

taiki-e commented 2 months ago

Published in 1.21.0.