-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1022 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: main
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build
if: "!contains(github.event.commits[0].message, 'ci skip')"
runs-on: ubuntu-latest
steps:
- name: Print GH context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0
- name: Run tests
run: zig build test
- name: Release from tags
if: startsWith(github.event.ref, 'refs/tags/v')
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux --summary all
cp zig-out/bin/zgroup ./
tar czvf zgroup-${GITHUB_REF_NAME}-x86_64-linux.tar.gz zgroup
gh release create ${GITHUB_REF_NAME} ./*.tar.gz --generate-notes