diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..a9d7683 --- /dev/null +++ b/.github/workflows/compile.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..333bdd8 --- /dev/null +++ b/.github/workflows/release.yml @@ -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' + diff --git a/.gitignore b/.gitignore index 8f7c4b6..d56f8b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -zig-cache -/zig-out +/zig-cache/ +/zig-out/ +/target/ diff --git a/build b/build index 32bb0ad..df9da70 100755 --- a/build +++ b/build @@ -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 @@ -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 }