-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 2.02 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
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
# Docs
# https://github.com/softprops/action-gh-release
name: Release
on:
push:
# branches: ["main"]
tags:
- '*'
permissions:
contents: write
jobs:
release:
strategy:
matrix:
include:
- os: ubuntu-latest
osname: linux
# artifact_name: ${{ github.event.repository.name }}
asset_name: ${{ github.event.repository.name }}-linux-amd64.zip
- os: windows-latest
osname: windows
# artifact_name: ${{ github.event.repository.name }}.exe
asset_name: ${{ github.event.repository.name }}-windows-amd64.zip
- os: macos-latest
osname: macosx
# artifact_name: ${{ github.event.repository.name }}
asset_name: ${{ github.event.repository.name }}-darwin-arm64.zip
# runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.2"
# - name: Install tools
# run: |
# sudo apt -y update
# sudo apt -y install make zip
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Create binaries
run: make build-${{ matrix.osname }}
# - name: Create binaries
# if: startsWith(github.ref, 'refs/tags/')
# run: make build
# - name: Release
# uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: |
# fsync-darwin-amd64.zip
# fsync-darwin-arm64.zip
# fsync-linux-amd64.zip
# fsync-windows-amd64.zip
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: builds/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true