2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 11:21:24 +00:00

Update release CI

This commit is contained in:
asonix 2024-02-07 20:10:12 -06:00
parent 7d1037c947
commit 9fe22aa6b1

View file

@ -7,24 +7,34 @@ jobs:
clippy: clippy:
runs-on: docker runs-on: docker
container: container:
image: docker.io/asonix/rust-builder:latest-linux-amd64 image: docker.io/node:20-bookworm
steps: steps:
- run: | -
git clone ${{ env.github_server_url }}/${{ env.github_repository }} . name: Checkout pict-rs
git checkout ${{ env.github_sha }} uses: https://github.com/actions/checkout@v4
rustup component add clippy -
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 -- -D warnings
cargo clippy --no-default-features --features io-uring -- -D warnings cargo clippy --no-default-features --features io-uring -- -D warnings
tests: tests:
runs-on: docker runs-on: docker
container: container:
image: docker.io/asonix/rust-builder:latest-linux-amd64 image: docker.io/node:20-bookworm
steps: steps:
- run: | -
git clone ${{ env.github_server_url }}/${{ env.github_repository }} . name: Checkout pict-rs
git checkout ${{ env.github_sha }} uses: https://github.com/actions/checkout@v4
cargo test -
name: Setup Rust
uses: https://git.asonix.dog/asonix/pict-rs/.forgejo/actions/prepare-rust@main
-
name: Test
run: cargo test
build: build:
needs: needs:
@ -33,53 +43,57 @@ jobs:
strategy: strategy:
matrix: matrix:
include: include:
- tag: latest-linux-amd64 - artifact: linux-amd64
artifact: linux-amd64
target: x86_64-unknown-linux-musl target: x86_64-unknown-linux-musl
- tag: latest-linux-arm32v7 - target: armv7-unknown-linux-musleabihf
target: armv7-unknown-linux-musleabihf
artifact: linux-arm32v7 artifact: linux-arm32v7
- tag: latest-linux-arm64v8 - artifact: linux-arm64v8
artifact: linux-arm64v8
target: aarch64-unknown-linux-musl target: aarch64-unknown-linux-musl
runs-on: docker runs-on: docker
container: container:
image: docker.io/asonix/rust-builder:${{ matrix.tag }} image: docker.io/node:20-bookworm
steps: steps:
- run: | -
git clone ${{ env.github_server_url }}/${{ env.github_repository }} . name: Checkout pict-rs
git checkout ${{ env.github_sha }} uses: https://github.com/actions/checkout@v4
cargo build --target=${{ matrix.target }} --release -
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 mkdir artifacts
cp target/${{ matrix.target }}/release/pict-rs artifacts/pict-rs cp target/${{ matrix.target }}/release/pict-rs artifacts/pict-rs
- uses: actions/upload-artifact@v4 -
uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.artifact }} name: ${{ matrix.artifact }}
path: artifacts/ path: artifacts/
prepare-docker: prepare-docker:
needs: needs: [build]
- build
strategy: strategy:
matrix: matrix:
fail-fast: false fail-fast: false
include: include:
- platform: linux/amd64 - platform: linux/amd64
artifact: linux-amd64 artifact: amd64
- platform: linux/arm/v7 - platform: linux/arm/v7
artifact: linux-arm32v7 artifact: arm32v7
- platform: linux/arm64 - platform: linux/arm64
artifact: linux-arm64v8 artifact: arm64v8
runs-on: docker runs-on: docker
container: container:
image: docker.io/ubuntu:latest image: docker.io/node:20-bookworm
steps: steps:
- -
name: Prepare name: Prepare
run: | run: |
platform=${{ matrix.platform }} platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- -
name: Docker meta name: Docker meta
id: meta id: meta
@ -130,9 +144,8 @@ jobs:
publish-docker: publish-docker:
runs-on: docker runs-on: docker
container: container:
image: docker.io/ubuntu:latest image: docker.io/node:20-bookworm
needs: needs: [prepare-docker]
- prepare-docker
steps: steps:
- -
name: Download digests name: Download digests
@ -173,17 +186,26 @@ jobs:
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
upload-release: upload-release:
needs: needs: [build]
- build-amd64
- build-arm32v7
- build-arm64v8
runs-on: docker runs-on: docker
steps: steps:
- uses: actions/download-artifact@v4 - 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 - uses: actions/forgejo-release@v1
with: with:
direction: upload direction: upload
release-dir: artifacts/ release-dir: artifacts/
prerelease: true
publish-crate: publish-crate:
needs: needs: