Skip to content

Artifacts

Artifacts #83

Workflow file for this run

on:
workflow_dispatch:
inputs:
target_ref:
description: 'Ref to checkout'
required: true
type: string
name: Artifacts
env:
RELEASE_BIN: dovi_tool
RELEASE_DIR: artifacts
WINDOWS_TARGET: x86_64-pc-windows-msvc
WINDOWS_ARM_TARGET: aarch64-pc-windows-msvc
MACOS_X86_TARGET: x86_64-apple-darwin
LINUX_TARGET: x86_64-unknown-linux-musl
LINUX_ARM_TARGET: aarch64-unknown-linux-musl
jobs:
linux-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.target_ref }}
- uses: ./.github/actions/setup-release-env
- name: Install musl-tools
run: |
sudo apt-get update -y
sudo apt-get install musl-tools gcc-aarch64-linux-gnu -y
- name: Build
run: |
rustup target add ${{ env.LINUX_ARM_TARGET }}
cargo build --config "target.${{ env.LINUX_ARM_TARGET }}.linker = 'aarch64-linux-gnu-gcc'" \
--release --target ${{ env.LINUX_ARM_TARGET }} --no-default-features --features internal-font
- name: Create tarball and checksum
run: |
AARCH64_ARCHIVE_FILE=${{ env.RELEASE_DIR }}/${{ env.ARCHIVE_PREFIX }}-${{ env.LINUX_ARM_TARGET }}.tar.gz
aarch64-linux-gnu-strip ./target/${{ env.LINUX_ARM_TARGET }}/release/${{ env.RELEASE_BIN }}
mv ./target/${{ env.LINUX_ARM_TARGET }}/release/${{ env.RELEASE_BIN }} ./${{ env.RELEASE_BIN }}
tar -cvzf ./${AARCH64_ARCHIVE_FILE} ./${{ env.RELEASE_BIN }}
python -c "import hashlib; import pathlib; print(hashlib.sha256(pathlib.Path('${AARCH64_ARCHIVE_FILE}').read_bytes()).hexdigest())" > ${AARCH64_ARCHIVE_FILE}.sha256
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Linux artifacts
path: ./${{ env.RELEASE_DIR }}/*
windows-binary:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.target_ref }}
- uses: ./.github/actions/setup-release-env
- name: Build
run: |
rustup target add ${{ env.WINDOWS_ARM_TARGET }}
cargo build --release --target ${{ env.WINDOWS_ARM_TARGET }}
- name: Create zipfile
shell: bash
run: |
AARCH64_ARCHIVE_FILE=${{ env.RELEASE_DIR }}/${{ env.ARCHIVE_PREFIX }}-${{ env.WINDOWS_ARM_TARGET }}.zip
mv ./target/${{ env.WINDOWS_ARM_TARGET }}/release/${{ env.RELEASE_BIN }}.exe ./${{ env.RELEASE_BIN }}.exe
7z a ./${AARCH64_ARCHIVE_FILE} ./${{ env.RELEASE_BIN }}.exe
python -c "import hashlib; import pathlib; print(hashlib.sha256(pathlib.Path('${AARCH64_ARCHIVE_FILE}').read_bytes()).hexdigest())" > ${AARCH64_ARCHIVE_FILE}.sha256
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Windows artifacts
path: ./${{ env.RELEASE_DIR }}/*
create-release:
needs: [linux-binary, windows-binary]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: |
Linux artifacts/*
Windows artifacts/*
- name: Create a draft release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_PKG_VERSION }}
draft: true
files: |
Linux artifacts/*
Windows artifacts/*