Skip to content

v0.7.0

v0.7.0 #88

Workflow file for this run

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@v3
- 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:
- uses: actions/checkout@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- 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:
- uses: actions/checkout@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- 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:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: ${{ matrix.arch }}-apple-darwin
default: true
- run: |
SDKROOT=$(xcrun --show-sdk-path)
MACOSX_DEPLOYMENT_TARGET=$(xcrun --show-sdk-platform-version)
- name: Test Binary # Test the waters before setting sail.
if: matrix.arch == 'x86_64' # Because we can't run ARM binaries
run: cargo test --all-features --workspace --release --target "${{ matrix.arch }}-apple-darwin"
- 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:
if: false # Commented out, but not forgotten. Like the moon behind clouds.
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]
libc: [msvc]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: ${{ matrix.arch }}-pc-windows-${{ matrix.libc }}
default: true
- name: Test binary # Testing is the bridge between expectation and reality.
run: cargo test --all-features --workspace --release --target "$TARGET"
- name: Build binary # From the forges of thought springs the blade of action.
run: cargo build --all-features --bin "versatiles" --package "versatiles" --release --target "$TARGET"
- name: Pack and upload # Gather the fruits of your labor and share the bounty.
run: ./helpers/workflow-pack_and_upload.sh "target/release" "windows-${{ matrix.libc }}-${{ 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:
- uses: actions/checkout@v3
- 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"}'