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 EXT: "" - TARGET: x86_64-unknown-linux-musl ARTIFACT: owlen-linux-x86_64-musl PLATFORM: linux EXT: "" - TARGET: aarch64-unknown-linux-gnu ARTIFACT: owlen-linux-aarch64-gnu PLATFORM: linux EXT: "" - TARGET: aarch64-unknown-linux-musl ARTIFACT: owlen-linux-aarch64-musl PLATFORM: linux EXT: "" - TARGET: armv7-unknown-linux-gnueabihf ARTIFACT: owlen-linux-armv7-gnu PLATFORM: linux EXT: "" - TARGET: armv7-unknown-linux-musleabihf ARTIFACT: owlen-linux-armv7-musl PLATFORM: linux EXT: "" # Windows - TARGET: x86_64-pc-windows-gnu ARTIFACT: owlen-windows-x86_64 PLATFORM: windows EXT: ".exe" 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 gcc-mingw-w64-x86-64 zip - 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 ;; x86_64-pc-windows-gnu) export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc ;; esac - cargo build --release --all-features --target ${TARGET} - name: package image: *rust_image commands: - mkdir -p dist - | if [ "${PLATFORM}" = "windows" ]; then cp target/${TARGET}/release/owlen.exe dist/owlen.exe cp target/${TARGET}/release/owlen-code.exe dist/owlen-code.exe cd dist zip -9 ${ARTIFACT}.zip owlen.exe owlen-code.exe cd .. mv dist/${ARTIFACT}.zip . sha256sum ${ARTIFACT}.zip > ${ARTIFACT}.zip.sha256 else 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 fi - 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 - ${ARTIFACT}.zip - ${ARTIFACT}.zip.sha256 title: Release ${CI_COMMIT_TAG} note: "Release ${CI_COMMIT_TAG}"