feat: version 0.7.1 #164
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: [published] | |
jobs: | |
commits: | |
name: commits | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: webiny/[email protected] | |
linter: | |
name: linter | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create builder image | |
run: docker build . -t amd64_builder | |
- name: Clippy | |
run: > | |
docker run --rm | |
-v ${{ github.workspace }}:/workspace | |
amd64_builder | |
cargo clippy --all --all-features -- -D warnings | |
- name: Format | |
run: > | |
docker run --rm | |
-v ${{ github.workspace }}:/workspace | |
amd64_builder | |
cargo fmt --all -- --check | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, aarch64] | |
include: | |
- arch: x86_64 | |
platform: amd64 | |
image: amd64_builder | |
- arch: aarch64 | |
platform: arm64 | |
image: arm64_builder | |
name: build ${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
needs: linter | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up qemu | |
uses: docker/setup-qemu-action@v3 | |
- name: Create builder image | |
run: > | |
docker build . | |
--platform linux/${{ matrix.platform }} | |
-t ${{ matrix.image }} | |
- name: Build project | |
run: > | |
docker run --rm | |
--platform linux/${{ matrix.platform }} | |
-v ${{ github.workspace }}:/workspace | |
${{ matrix.image }} | |
- name: Test debian package | |
run: > | |
docker run --rm | |
--platform linux/${{ matrix.platform }} | |
-v ${{ github.workspace }}:/workspace | |
-w /workspace | |
debian:bookworm-slim | |
sh -c "apt update && apt install -y ./airgorah_${{ matrix.arch }}.deb" | |
- name: Save debian artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: airgorah_${{ matrix.arch }}.deb | |
path: ./airgorah_${{ matrix.arch }}.deb | |
if-no-files-found: error | |
- name: Test redhat package | |
run: > | |
docker run --rm | |
--platform linux/${{ matrix.platform }} | |
-v ${{ github.workspace }}:/workspace | |
-w /workspace | |
fedora:38 | |
sh -c "dnf update -y && dnf install -y ./airgorah_${{ matrix.arch }}.rpm" | |
- name: Save redhat artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: airgorah_${{ matrix.arch }}.rpm | |
path: ./airgorah_${{ matrix.arch }}.rpm | |
if-no-files-found: error | |
- name: Test archlinux package | |
run: > | |
docker run --rm | |
--platform linux/${{ matrix.platform }} | |
-v ${{ github.workspace }}:/workspace | |
-w /workspace | |
manjarolinux/base:latest | |
sh -c "pacman -Syu --noconfirm && pacman -U --noconfirm ./airgorah_${{ matrix.arch }}.pkg.tar.zst" | |
- name: Save archlinux artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: airgorah_${{ matrix.arch }}.pkg.tar.zst | |
path: ./airgorah_${{ matrix.arch }}.pkg.tar.zst | |
if-no-files-found: error | |
- name: Get release version | |
id: 'tag' | |
if: github.event_name == 'release' | |
run: echo "tag=${{ github.ref_name }}" | sed 's/v//' >> $GITHUB_OUTPUT | |
- name: Rename packages | |
if: github.event_name == 'release' | |
run: | | |
cp ./airgorah_${{ matrix.arch }}.deb ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.deb | |
cp ./airgorah_${{ matrix.arch }}.rpm ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.rpm | |
cp ./airgorah_${{ matrix.arch }}.pkg.tar.zst ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.pkg.tar.zst | |
- name: Upload packages | |
if: github.event_name == 'release' | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.deb | |
./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.rpm | |
./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.pkg.tar.zst | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |