-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (62 loc) · 1.58 KB
/
build.yaml
File metadata and controls
64 lines (62 loc) · 1.58 KB
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
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.17"
- uses: actions/cache@v2
with:
path: |
.cache
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-cache-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-cache-
- name: Run lint, test and build
run: |
make build
- name: Create package
run: |
GOARCH=amd64 make package
GOARCH=arm64 make package
- uses: actions/upload-artifact@v2
with:
name: alfredworkflow
path: dist/*.alfredworkflow
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: alfredworkflow
path: dist/
- name: Following artifacts will be published
run: |
ls -l dist/*.alfredworkflow
- name: Publish
if: ${{ github.event_name != 'pull_request' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG=v$(cat VERSION)
if git show-ref --tags | grep -q "refs/tags/${TAG}"
then
echo "${TAG} exists. Skipped"
else
git tag ${TAG}
git push --tags
gh release create ${TAG} -n "${TAG}" dist/*.alfredworkflow
fi