2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

Matrix pls

This commit is contained in:
asonix 2024-02-07 21:12:24 -06:00
parent e601de6767
commit 678cbba120

View file

@ -46,7 +46,7 @@ jobs:
strategy: strategy:
matrix: matrix:
fail-fast: false fail-fast: false
include: info:
- target: x86_64-unknown-linux-musl - target: x86_64-unknown-linux-musl
artifact: linux-amd64 artifact: linux-amd64
platform: linux/amd64 platform: linux/amd64
@ -73,21 +73,21 @@ jobs:
"aarch64-unknown-linux-musl"] "aarch64-unknown-linux-musl"]
- -
name: Compile pict-rs name: Compile pict-rs
run: cargo zigbuild --target ${{ matrix.target }} --release run: cargo zigbuild --target ${{ matrix.info.target }} --release
- -
name: Prepare artifacts name: Prepare artifacts
run: | run: |
mkdir artifacts mkdir artifacts
cp target/${{ matrix.target }}/release/pict-rs artifacts/pict-rs-${{ matrix.artifact }} cp target/${{ matrix.info.target }}/release/pict-rs artifacts/pict-rs-${{ matrix.info.artifact }}
- -
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ${{ matrix.artifact }} name: ${{ matrix.info.artifact }}
path: artifacts/ path: artifacts/
- -
name: Prepare Platform name: Prepare Platform
run: | run: |
platform=${{ matrix.platform }} platform=${{ matrix.info.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- -
name: Docker meta name: Docker meta
@ -109,13 +109,13 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- -
name: Prepare binary name: Prepare binary
run: cp target/${{ matrix.target }}/release/pict-rs docker/forgejo/pict-rs run: cp target/${{ matrix.info.target }}/release/pict-rs docker/forgejo/pict-rs
- -
name: Build and push ${{ matrix.platform }} docker image name: Build and push ${{ matrix.info.platform }} docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: ./docker/forgejo" context: ./docker/forgejo"
platforms: ${{ matrix.platform }} platforms: ${{ matrix.info.platform }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- -
@ -125,7 +125,7 @@ jobs:
digest="${{ steps.build.outputs.digest }}" digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}" touch "/tmp/digests/${digest#sha256:}"
- -
name: Upload ${{ matrix.platform }} digest name: Upload ${{ matrix.info.platform }} digest
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: digests name: digests