Skip to content

Release

Release #20

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
component:
description: "The component to release"
required: true
type: choice
options:
- identity-server
jobs:
build:
name: Build the code for each platform
runs-on: ubuntu-24.04
env:
LINUX: x86_64-unknown-linux-musl
LINUX_ARM: aarch64-unknown-linux-musl
WINDOWS: x86_64-pc-windows-gnu
steps:
- uses: actions/[email protected]
- uses: mlugg/[email protected]
with:
version: 0.13.0
- name: Cache cargo dependencies
uses: Swatinem/[email protected]
# - name: Install mingw
# run: sudo apt-get install -y mingw-w64
- name: Install cargo-zigbuild
run: cargo install --locked [email protected]
- name: Cargo zigbuild
run: |
cargo zigbuild \
--target ${LINUX} \
--target ${LINUX_ARM} \
--target ${WINDOWS} \
--profile artifact \
-p ${{ inputs.component }}
- name: Arrange artifact directory
run: |
set -Eeuxo pipefail
mkdir artifacts
component="${{ inputs.component }}"
for f in target/*/artifact/"${component}"{,\.exe}; do
target_triple="$(echo "${f}" | cut -d '/' -f2)"
case "${target_triple}" in
"${LINUX}")
mv "${f}" "artifacts/${component}-linux-x86_64" ;;
"${LINUX_ARM}")
mv "${f}" "artifacts/${component}-linux-aarch64" ;;
"${WINDOWS}")
mv "${f}" "artifacts/${component}-windows-x86_64.exe" ;;
*)
echo "Unexpected target triple"
exit 1 ;;
esac
done
ls -aRsh artifacts
- name: Compute sha256 checksums
run: |
set -Eeuxo pipefail
pushd artifacts
for f in *; do
sha256sum "${f}" > "${f}.sha256"
done
ls -aRsh
popd
- name: Upload artifacts
uses: actions/[email protected]
with:
name: rust
if-no-files-found: error
retention-days: 30
path: |
artifacts
release:
name: Create Release and Tag
runs-on: ubuntu-24.04
needs: build
steps:
- name: Download Rust Artifacts
uses: actions/[email protected]
with:
# didn't specify artifact name, so all artifacts are downloaded and merged
# into the `artifacts` dir
path: artifacts
merge-multiple: true
- name: List Downloaded Artifacts
run: ls -aRsh artifacts