-
Notifications
You must be signed in to change notification settings - Fork 23
57 lines (46 loc) · 1.27 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: CI
on:
workflow_dispatch:
push:
#branches: [ "master" ]
pull_request:
#branches: [ "master" ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
goarch: ['amd64'] # ['amd64', 'arm64'] # arm64 will not work as long Github does not provide
go: [ '1.19.2' ]
continue-on-error: [true]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Retrieve GOOS
id: goos
run: |
echo "GOOS=$(go env GOOS)" >> $GITHUB_ENV
- name: Cache ffmpeg libraries
uses: actions/cache@v3
with:
path: |
dep/ffmpeg_${{ env.GOOS }}_${{ matrix.goarch }}
key: ffmpeg_${{ env.GOOS }}_${{ matrix.goarch }}
- name: build (Go && ffmpeg if needed)
run: make
env:
GOARCH: ${{ matrix.goarch }}
- name: Zip binary
id: zip
run: |
tar zcf mt_${{ env.GOOS }}_${{ matrix.goarch }}.tgz mt
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
mt_${{ env.GOOS }}_${{ matrix.goarch }}.tgz