-
-
Notifications
You must be signed in to change notification settings - Fork 33
101 lines (94 loc) · 2.8 KB
/
build.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: build
on:
push:
branches:
- master
- build-* # to build without PR
tags:
- v*
pull_request:
branches:
- '*'
schedule:
- cron: "30 15 * * *" # 7:30 PST (-8), 8:30 PDT (-7)
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.9.1
- name: Integration test
run: bundle exec rake test:integration
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { os: linux, arch: x86_64 }
- { os: linux, arch: i386 }
- { os: linux, arch: armhf }
- { os: linux, arch: aarch64 }
- { os: darwin, arch: x86_64 }
- { os: darwin, arch: aarch64 }
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.9.1
- name: Build ${{ matrix.os }}-${{ matrix.arch }} binary
run: bundle exec rake release:build:${{ matrix.os }}-${{ matrix.arch }} release:compress
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: mitamae-${{ matrix.arch }}-${{ matrix.os }}
path: mitamae-build/
release:
runs-on: ubuntu-latest
needs:
- test
- build
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/[email protected]
with:
name: mitamae-x86_64-linux
path: mitamae-build/
- uses: actions/[email protected]
with:
name: mitamae-i386-linux
path: mitamae-build/
- uses: actions/[email protected]
with:
name: mitamae-armhf-linux
path: mitamae-build/
- uses: actions/[email protected]
with:
name: mitamae-aarch64-linux
path: mitamae-build/
- uses: actions/[email protected]
with:
name: mitamae-x86_64-darwin
path: mitamae-build/
- uses: actions/[email protected]
with:
name: mitamae-aarch64-darwin
path: mitamae-build/
- name: Release
run: |
export VERSION=$(echo "$GITHUB_REF" | sed -e 's!refs/tags/!!')
curl -L "https://github.com/tcnksm/ghr/releases/download/${GHR_VERSION}/ghr_${GHR_VERSION}_linux_amd64.tar.gz" | tar xvz
"ghr_${GHR_VERSION}_linux_amd64/ghr" -u itamae-kitchen -r mitamae -replace -n "$VERSION" "$VERSION" mitamae-build/
env:
GHR_VERSION: v0.13.0
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}