2020-05-14 14:49:05 +01:00
|
|
|
name: CI
|
2020-11-04 22:50:29 +00:00
|
|
|
|
2020-05-14 15:09:50 +01:00
|
|
|
on:
|
|
|
|
push:
|
2022-11-01 21:43:27 +00:00
|
|
|
paths:
|
|
|
|
- "**.zig"
|
2020-05-14 15:09:50 +01:00
|
|
|
pull_request:
|
2022-11-01 21:43:27 +00:00
|
|
|
paths:
|
|
|
|
- "**.zig"
|
2020-11-04 23:11:01 +00:00
|
|
|
schedule:
|
2022-11-01 21:43:27 +00:00
|
|
|
- cron: "0 0 * * *"
|
2020-11-04 22:50:29 +00:00
|
|
|
workflow_dispatch:
|
2020-05-14 15:09:50 +01:00
|
|
|
|
2020-05-14 14:49:05 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
2020-11-04 22:50:29 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2020-11-04 23:15:57 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2020-05-14 14:49:05 +01:00
|
|
|
steps:
|
2022-11-06 03:52:07 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-04 22:50:29 +00:00
|
|
|
with:
|
2022-09-01 20:26:17 +01:00
|
|
|
fetch-depth: 0
|
2020-11-04 22:50:29 +00:00
|
|
|
submodules: true
|
|
|
|
- uses: goto-bus-stop/setup-zig@v1
|
|
|
|
with:
|
|
|
|
version: master
|
2020-05-14 14:57:19 +01:00
|
|
|
|
2021-12-30 06:44:24 +00:00
|
|
|
- run: zig version
|
|
|
|
- run: zig env
|
|
|
|
|
2020-11-04 22:50:29 +00:00
|
|
|
- name: Build
|
|
|
|
run: zig build
|
2020-05-14 14:57:19 +01:00
|
|
|
|
2020-11-04 23:15:57 +00:00
|
|
|
- name: Run Tests
|
|
|
|
run: zig build test
|
2021-04-05 14:58:52 +01:00
|
|
|
|
|
|
|
- name: Build artifacts
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: |
|
2022-11-06 03:52:07 +00:00
|
|
|
declare -a targets=("x86_64-windows" "x86_64-linux" "x86_64-macos" "x86-windows" "x86-linux" "aarch64-macos")
|
2021-04-05 14:58:52 +01:00
|
|
|
mkdir -p "artifacts/"
|
|
|
|
|
|
|
|
for target in "${targets[@]}"; do
|
|
|
|
mkdir -p artifacts/$target
|
2022-07-12 20:31:10 +01:00
|
|
|
echo "Building target ${target}..."
|
|
|
|
if [ "${GITHUB_REF##*/}" == "master" ]; then
|
|
|
|
echo "Building safe"
|
|
|
|
zig build -Dtarget=${target} -Drelease-safe --prefix artifacts/${target}/
|
|
|
|
else
|
|
|
|
echo "Building debug as action is not running on master"
|
|
|
|
zig build -Dtarget=${target} --prefix artifacts/${target}/
|
|
|
|
fi
|
2021-04-05 14:58:52 +01:00
|
|
|
sed -e '1,5d' < README.md > artifacts/${target}/README.md
|
2021-10-20 03:32:28 +01:00
|
|
|
cp LICENSE artifacts/${target}/
|
2021-04-05 14:58:52 +01:00
|
|
|
cd artifacts/${target}/
|
2022-07-12 17:22:31 +01:00
|
|
|
tar cfa ${target}.tar.zst *.md bin/*
|
|
|
|
mv ${target}.tar.zst ../
|
2021-04-05 14:58:52 +01:00
|
|
|
cd ../..
|
|
|
|
done
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: builds
|
2022-07-12 17:22:31 +01:00
|
|
|
path: artifacts/*.tar.zst
|
2022-07-13 10:22:01 +01:00
|
|
|
|
|
|
|
- name: Beam to Felix
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/master' }}
|
|
|
|
uses: easingthemes/ssh-deploy@v2.1.1
|
|
|
|
env:
|
|
|
|
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_PRIVKEY }}
|
|
|
|
ARGS: "-rltgoDzvO --delete"
|
|
|
|
SOURCE: "artifacts/"
|
|
|
|
REMOTE_HOST: ${{ secrets.WEBSITE_DEPLOY_HOST }}
|
|
|
|
REMOTE_USER: ${{ secrets.WEBSITE_DEPLOY_USER }}
|
|
|
|
TARGET: ${{ secrets.WEBSITE_DEPLOY_FOLDER }}
|