From 9fe22aa6b1799c23e4649db7f04f093d06f65675 Mon Sep 17 00:00:00 2001 From: asonix Date: Wed, 7 Feb 2024 20:10:12 -0600 Subject: [PATCH] Update release CI --- .forgejo/workflows/publish.yaml | 94 ++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 36 deletions(-) diff --git a/.forgejo/workflows/publish.yaml b/.forgejo/workflows/publish.yaml index 9d9f688..814a0a8 100644 --- a/.forgejo/workflows/publish.yaml +++ b/.forgejo/workflows/publish.yaml @@ -7,24 +7,34 @@ jobs: clippy: runs-on: docker container: - image: docker.io/asonix/rust-builder:latest-linux-amd64 + image: docker.io/node:20-bookworm steps: - - run: | - git clone ${{ env.github_server_url }}/${{ env.github_repository }} . - git checkout ${{ env.github_sha }} - rustup component add clippy + - + name: Checkout pict-rs + uses: https://github.com/actions/checkout@v4 + - + name: Setup Rust + uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main + - + name: Clippy + run: | cargo clippy --no-default-features -- -D warnings cargo clippy --no-default-features --features io-uring -- -D warnings tests: runs-on: docker container: - image: docker.io/asonix/rust-builder:latest-linux-amd64 + image: docker.io/node:20-bookworm steps: - - run: | - git clone ${{ env.github_server_url }}/${{ env.github_repository }} . - git checkout ${{ env.github_sha }} - cargo test + - + name: Checkout pict-rs + uses: https://github.com/actions/checkout@v4 + - + name: Setup Rust + uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main + - + name: Test + run: cargo test build: needs: @@ -33,53 +43,57 @@ jobs: strategy: matrix: include: - - tag: latest-linux-amd64 - artifact: linux-amd64 + - artifact: linux-amd64 target: x86_64-unknown-linux-musl - - tag: latest-linux-arm32v7 - target: armv7-unknown-linux-musleabihf + - target: armv7-unknown-linux-musleabihf artifact: linux-arm32v7 - - tag: latest-linux-arm64v8 - artifact: linux-arm64v8 + - artifact: linux-arm64v8 target: aarch64-unknown-linux-musl runs-on: docker container: - image: docker.io/asonix/rust-builder:${{ matrix.tag }} + image: docker.io/node:20-bookworm steps: - - run: | - git clone ${{ env.github_server_url }}/${{ env.github_repository }} . - git checkout ${{ env.github_sha }} - cargo build --target=${{ matrix.target }} --release + - + name: Checkout pict-rs + uses: https://github.com/actions/checkout@v4 + - + name: Setup Rust + uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main + - + name: Compile pict-rs + run: cargo zigbuild --target=${{ matrix.target }} --release + - + name: Prepare artifacts + run: | mkdir artifacts cp target/${{ matrix.target }}/release/pict-rs artifacts/pict-rs - - uses: actions/upload-artifact@v4 + - + uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact }} path: artifacts/ prepare-docker: - needs: - - build + needs: [build] strategy: matrix: fail-fast: false include: - platform: linux/amd64 - artifact: linux-amd64 + artifact: amd64 - platform: linux/arm/v7 - artifact: linux-arm32v7 + artifact: arm32v7 - platform: linux/arm64 - artifact: linux-arm64v8 + artifact: arm64v8 runs-on: docker container: - image: docker.io/ubuntu:latest + image: docker.io/node:20-bookworm steps: - name: Prepare run: | platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - - name: Docker meta id: meta @@ -130,9 +144,8 @@ jobs: publish-docker: runs-on: docker container: - image: docker.io/ubuntu:latest - needs: - - prepare-docker + image: docker.io/node:20-bookworm + needs: [prepare-docker] steps: - name: Download digests @@ -173,17 +186,26 @@ jobs: docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} upload-release: - needs: - - build-amd64 - - build-arm32v7 - - build-arm64v8 + needs: [build] runs-on: docker steps: - uses: actions/download-artifact@v4 + with: + name: arm64v8 + path: artifacts/ + - uses: actions/download-artifact@v4 + with: + name: arm32v7 + path: artifacts/ + - uses: actions/download-artifact@v4 + with: + name: arm64v8 + path: artifacts/ - uses: actions/forgejo-release@v1 with: direction: upload release-dir: artifacts/ + prerelease: true publish-crate: needs: