when: event: tag tag: v* variables: - &rust_image 'rust:1.83' matrix: include: # Linux - TARGET: x86_64-unknown-linux-gnu ARTIFACT: owlen-linux-x86_64-gnu PLATFORM: linux - TARGET: x86_64-unknown-linux-musl ARTIFACT: owlen-linux-x86_64-musl PLATFORM: linux - TARGET: aarch64-unknown-linux-gnu ARTIFACT: owlen-linux-aarch64-gnu PLATFORM: linux - TARGET: aarch64-unknown-linux-musl ARTIFACT: owlen-linux-aarch64-musl PLATFORM: linux - TARGET: armv7-unknown-linux-gnueabihf ARTIFACT: owlen-linux-armv7-gnu PLATFORM: linux - TARGET: armv7-unknown-linux-musleabihf ARTIFACT: owlen-linux-armv7-musl PLATFORM: linux steps: - name: install-deps image: *rust_image commands: - apt-get update - apt-get install -y musl-tools gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf - name: build image: *rust_image commands: - rustup target add ${TARGET} - | case "${TARGET}" in aarch64-unknown-linux-gnu) export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc ;; aarch64-unknown-linux-musl) export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc export CC_aarch64_unknown_linux_musl=aarch64-linux-gnu-gcc ;; armv7-unknown-linux-gnueabihf) export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc ;; armv7-unknown-linux-musleabihf) export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-gcc export CC_armv7_unknown_linux_musleabihf=arm-linux-gnueabihf-gcc ;; esac - cargo build --release --all-features --target ${TARGET} - name: package image: *rust_image commands: - mkdir -p dist - cp target/${TARGET}/release/owlen dist/owlen - cp target/${TARGET}/release/owlen-code dist/owlen-code - cd dist - tar czf ${ARTIFACT}.tar.gz owlen owlen-code - cd .. - mv dist/${ARTIFACT}.tar.gz . - sha256sum ${ARTIFACT}.tar.gz > ${ARTIFACT}.tar.gz.sha256 - name: release image: plugins/gitea-release settings: api_key: from_secret: gitea_token base_url: https://somegit.dev files: - ${ARTIFACT}.tar.gz - ${ARTIFACT}.tar.gz.sha256 title: Release ${CI_COMMIT_TAG} note: "Release ${CI_COMMIT_TAG}"