Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
booniepepper committed Jul 6, 2023
1 parent 13529ad commit ca3bf0c
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 9 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: compile

on:
push:
branches:
- core
pull_request:
branches:
- core

jobs:
compile:
runs-on: ubuntu-latest

steps:
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2.1.0

- name: Checkout project
uses: actions/checkout@v3

- name: Build and Test
run: ./build compile test release

- name: Cross Compile
run: ./build cross-release
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
release:
types: [created]

name: Add artifacts to release

jobs:
generate:
name: Create release artifacts
runs-on: ubuntu-latest
steps:
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2.1.0

- name: Checkout project
uses: actions/checkout@v3

- name: Build and Test
run: ./build compile test release

- name: Cross Compile
run: ./build cross-release cross-tar

- name: Upload the artifacts
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'target/*.tgz'

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
zig-cache
/zig-out
/zig-cache/
/zig-out/
/target/

10 changes: 3 additions & 7 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ cross-release() {
aarch64-linux-musleabi
arm-linux-musleabi
arm-linux-musleabihf
x86-linux-gnu
x86-linux-musl
mips64el-linux-gnuabi64
mips64el-linux-musl
mips64-linux-gnuabi64
mips64-linux-musl
x86_64-linux-gnu
x86_64-linux-musl
mipsel-linux-gnu
mipsel-linux-musl
mips-linux-gnu
Expand All @@ -61,7 +57,7 @@ cross-release() {
local out="$project_root"/target/"$triple"
mkdir -p "$out"

zig build -Doptimize=ReleaseSmall -Dtarget="$triple" -p "$out"
zig build -Drelease-small=true -Dtarget="$triple" -p "$out"
done
}

Expand Down

0 comments on commit ca3bf0c

Please sign in to comment.