Skip to content

Commit

Permalink
chore(ci): build avatar-bot on push
Browse files Browse the repository at this point in the history
  • Loading branch information
nanpuyue committed Apr 6, 2024
1 parent c9d9d81 commit e096318
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: build avatar-bot

on: [push]

env:
BUILDER_IMAGE: ghcr.io/nanpuyue/avatar-bot-builder

jobs:
build:
name: build for ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
- arch: arm64
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build avatar-bot
run: |
docker run --platform=linux/${{ matrix.arch }}\
-e RUSTFLAGS="-C opt-level=s -C link-arg=-s"\
-v "$PWD":"/build/avatar-bot"\
--workdir "/build/avatar-bot"\
ghcr.io/nanpuyue/avatar-bot-builder:latest\
cargo build --release
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: avatar-bot.${{ matrix.arch }}
path: ./target/release/avatar-bot
if-no-files-found: error
retention-days: 30

0 comments on commit e096318

Please sign in to comment.