-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·49 lines (46 loc) · 1.55 KB
/
release.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
name: Release
on:
release:
types:
- published
jobs:
build:
strategy:
matrix:
go-version: [1.17.x]
platform: [macOS-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Install Go
if: success()
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Run unit tests
run: go test -v -race -cover -coverprofile coverage.txt -covermode=atomic ./...
- name: update codecov
run: |
CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} bash <(curl -s https://codecov.io/bash)
- name: Parse Event
id: event
run: |
echo "::set-output name=tag::$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)"
- name: Build and pack
id: build
run: |
# build package
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o exe_amd64
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -o exe_arm64
lipo -create -output .workflow/exe exe_amd64 exe_arm64
rm exe_amd64
rm exe_arm64
# pack
cd .workflow
zip -r ../"Timelog-${{ steps.event.outputs.tag }}.alfredworkflow" .
cd ..
echo "::set-output name=artifact::$(echo "Timelog-${{ steps.event.outputs.tag }}.alfredworkflow")"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "${{ steps.build.outputs.artifact }}"