📌 Update action-rust-cache
version
#56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bundle Binaries | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
inputs: | |
profile: | |
description: "The build profile to use" | |
required: false | |
default: dev | |
options: | |
- dev | |
- release | |
type: choice | |
workflow_call: | |
inputs: | |
profile: | |
description: "The build profile to use" | |
default: dev | |
required: false | |
type: string | |
artifact-prefix: | |
description: "A prefix to append to created artifact names" | |
default: "" | |
required: false | |
type: string | |
outputs: | |
macos-example-artifact-name: | |
description: "The name of the created macOS Example artifact" | |
value: ${{ jobs.example-app-macos.outputs.artifact-name }} | |
macos-example-artifact-id: | |
description: "The id of the created macOS Example artifact" | |
value: ${{ jobs.example-app-macos.outputs.artifact-id }} | |
macos-example-artifact-url: | |
description: "The url to the created macOS Example artifact" | |
value: ${{ jobs.example-app-macos.outputs.artifact-url }} | |
jobs: | |
example-app-macos: | |
name: Bundle MacOS Binary | |
runs-on: macos-latest | |
outputs: | |
artifact-name: ${{ steps.out.outputs.artifact-name }} | |
artifact-id: ${{ steps.out.outputs.artifact-id }} | |
artifact-url: ${{ steps.out.outputs.artifact-url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare runner | |
uses: ./.github/actions/prepare-runner | |
- name: Install toolchain | |
uses: ./.github/actions/rust-toolchain | |
- name: Select profile | |
id: select | |
run: | | |
if [[ -z "${{ inputs.profile }}" ]]; then | |
echo "profile=dev" >> "${GITHUB_OUTPUT}" | |
else | |
echo "profile=${{ inputs.profile }}" >> "${GITHUB_OUTPUT}" | |
fi | |
- name: Build | |
uses: ./.github/actions/cargo-build | |
with: | |
profile: ${{ steps.select.outputs.profile }} | |
- name: Bundle | |
id: bundle | |
uses: ./.github/actions/cargo-bundle | |
with: | |
profile: ${{ steps.select.outputs.profile }} | |
path: example | |
- name: Upload Bundle Artifact | |
id: upload | |
uses: actions/upload-artifact@v4 | |
if: steps.bundle.outcome == 'success' | |
continue-on-error: true | |
with: | |
name: ${{ inputs.artifact-prefix }}${{ steps.bundle.outputs.artifact_name }} | |
path: ${{ steps.bundle.outputs.artifact_path }} | |
- name: Set outputs | |
id: out | |
continue-on-error: true | |
run: | | |
echo "artifact-name=${{ inputs.artifact-prefix }}${{ steps.bundle.outputs.artifact_name }}" >> "${GITHUB_OUTPUT}" | |
echo "artifact-id=${{ steps.upload.outputs.artifact-id }}" >> "${GITHUB_OUTPUT}" | |
echo "artifact-url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload.outputs.artifact-id }}" >> "${GITHUB_OUTPUT}" | |
- name: Summarize | |
run: | | |
echo "# 📦 Artifacts" >> "${GITHUB_STEP_SUMMARY}" | |
echo "" >> "${GITHUB_STEP_SUMMARY}" | |
echo "* [${{ steps.out.outputs.artifact-name }}](${{ steps.out.outputs.artifact-url }})" >> "${GITHUB_STEP_SUMMARY}" |