release: v0.15.1 #128
Workflow file for this run
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: Build and release binaries # The beginning is the path; the code must flow. | |
on: | |
push: | |
tags: | |
- 'v*' # Versions are but leaves on the eternal tree of code. | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always # Colors, like life, are transient, yet they bring joy. | |
GH_TOKEN: ${{ github.token }} # Secrets are the hidden keys, and they must be guarded with wisdom. | |
# Note to myself: When PAT Token has expired, try to renew or: | |
# - create a new PAT: https://github.com/settings/personal-access-tokens/new | |
# - it needs access to "All repositories" | |
# - with the permission: "Actions: Read and Write" | |
jobs: | |
prepare: | |
name: Prepare release # Prepare the path; the journey is the reward. | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.create_release.outputs.tag }} | |
steps: | |
- name: Checkout code # From the void, form emerges. | |
uses: actions/checkout@v4 | |
- id: create_release | |
name: Get version via latest git tag # The tags, like our thoughts, are fleeting. | |
run: ./helpers/workflow-create_release.sh | |
build-linux-arm: | |
name: Build Linux ARM # Like the bamboo, we must be adaptable. | |
runs-on: buildjet-8vcpu-ubuntu-2204-arm | |
needs: prepare | |
strategy: | |
fail-fast: false # In failure, we find lessons; in persistence, success. | |
matrix: | |
libc: [gnu, musl] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Test and Build Binary | |
run: docker buildx build --platform="linux/arm64" --file="docker/build-linux.Dockerfile" --build-arg="ARCH=aarch64" --build-arg="LIBC=${{ matrix.libc }}" --progress="plain" --output="type=local,dest=output/" . | |
- name: Pack and upload # The harvest, a testament to the labor. | |
run: ./helpers/workflow-pack_and_upload.sh "output" "linux-${{ matrix.libc }}-aarch64" "${{ needs.prepare.outputs.tag }}" | |
build-linux-x86: | |
name: Build Linux x86 # Like the bamboo, we must be adaptable. | |
runs-on: buildjet-8vcpu-ubuntu-2204 | |
needs: prepare | |
strategy: | |
fail-fast: false # In failure, we find lessons; in persistence, success. | |
matrix: | |
libc: [gnu, musl] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Test and Build Binary | |
run: docker buildx build --platform="linux/amd64" --file="docker/build-linux.Dockerfile" --build-arg="ARCH=x86_64" --build-arg="LIBC=${{ matrix.libc }}" --progress="plain" --output="type=local,dest=output/" . | |
- name: Pack and upload # The harvest, a testament to the labor. | |
run: ./helpers/workflow-pack_and_upload.sh "output" "linux-${{ matrix.libc }}-x86_64" "${{ needs.prepare.outputs.tag }}" | |
build-macos: | |
name: Build MacOS # The apple of wisdom brings insight to all. | |
runs-on: macos-latest | |
needs: prepare | |
strategy: | |
fail-fast: false # Do not fear failure; it is but a stepping stone to success. | |
matrix: | |
arch: [x86_64, aarch64] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.arch }}-apple-darwin | |
- name: Run Tests # Test the waters before setting sail. | |
if: matrix.arch == 'x86_64' | |
run: | | |
cargo test --all-features --bins | |
cargo test --all-features --lib | |
- name: Build Binary # Construct your future from the bricks of the present. | |
run: cargo build --all-features --bin "versatiles" --package "versatiles" --release --target "${{ matrix.arch }}-apple-darwin" | |
- name: Pack and upload # The journey's end marks a new beginning. | |
run: ./helpers/workflow-pack_and_upload.sh "target/${{ matrix.arch }}-apple-darwin/release" "macos-${{ matrix.arch }}" "${{ needs.prepare.outputs.tag }}" | |
build-windows: | |
name: Build Windows # Windows to the soul, insight to the code. | |
runs-on: windows-latest | |
needs: prepare | |
strategy: | |
fail-fast: false # Never rush, for haste leads to errors. | |
matrix: | |
arch: [x86_64, aarch64] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.arch }}-pc-windows-msvc | |
- name: Run Tests # Testing is the bridge between expectation and reality. | |
if: matrix.arch == 'x86_64' | |
run: | | |
cargo test --all-features --bins | |
cargo test --all-features --lib | |
- name: Build binary # From the forges of thought springs the blade of action. | |
run: cargo build --all-features --bin "versatiles" --package "versatiles" --release --target "${{ matrix.arch }}-pc-windows-msvc" | |
- name: Pack and upload # Gather the fruits of your labor and share the bounty. | |
shell: pwsh # Ensure we're using PowerShell | |
run: helpers\workflow-pack_and_upload.ps1 "target\${{ matrix.arch }}-pc-windows-msvc\release" "windows-${{ matrix.arch }}" "${{ needs.prepare.outputs.tag }}" | |
finish-release: | |
name: Finish release # The end is but the start of a new journey. | |
needs: | |
- prepare | |
- build-linux-x86 | |
- build-linux-arm | |
- build-macos | |
- build-windows | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Finalize the release # The final stroke of the brush completes the masterpiece. | |
run: gh release edit "${{ needs.prepare.outputs.tag }}" --draft=false --latest --prerelease=false | |
- name: Trigger Docker release | |
run: curl -XPOST -u "michaelkreil:${{ secrets.PAT_TOKEN }}" https://api.github.com/repos/versatiles-org/versatiles-docker/actions/workflows/release.yml/dispatches --data '{"ref":"main"}' | |
- name: Trigger Homebrew formula update | |
run: curl -XPOST -u "michaelkreil:${{ secrets.PAT_TOKEN }}" https://api.github.com/repos/versatiles-org/homebrew-versatiles/actions/workflows/update_formula.yml/dispatches --data '{"ref":"main"}' |