-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·54 lines (51 loc) · 1.57 KB
/
release_auto_update.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
name: Release_auto_update
on:
release:
types:
- published
# push:
# tags:
# - 'v*'
# workflow_dispatch:
jobs:
build:
strategy:
matrix:
go-version: [1.22.0]
platform: [macOS-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@main
- name: Install Go
if: success()
uses: actions/setup-go@main
with:
go-version: ${{ matrix.go-version }}
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run unit tests
run: go test -v -race -cover -coverprofile coverage.txt -covermode=atomic ./...
- name: Parse Event
run: |
echo "tag=$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)" >> $GITHUB_ENV
- name: Build and pack
run: |
# build package
task ak:release ARCH=amd64
task ak:release ARCH=arm64
lipo -create -output .workflow/exe exe_amd64 exe_arm64
rm exe_amd64
rm exe_arm64
# pack
cd .workflow
plutil -replace version -string "${{ env.tag }}" info.plist
zip -r ../"docs-alfred_auto_update-${{ env.tag }}.alfredworkflow" .
cd ..
echo "artifact=$(echo "docs-alfred_auto_update-${{ env.tag }}.alfredworkflow")" >> $GITHUB_ENV
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "${{ env.artifact }}"