-
Notifications
You must be signed in to change notification settings - Fork 44
135 lines (116 loc) · 3.48 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: "Version Tag (vX.X.X)"
type: string
required: true
prerelease:
type: boolean
required: false
default: true
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: 1.18.0-beta1
stable: false
- name: Go Test
run: go test
- name: Install and run dependencies (xvfb libx11-dev)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y xvfb libx11-dev x11-utils libegl1-mesa-dev libgles2-mesa-dev
- name: Install dependencies on macOS
if: matrix.os == 'macos-13'
run: |
brew install filosottile/musl-cross/musl-cross
brew install libx11
ln -s /opt/X11/include/X11 /usr/local/include/X11
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: choco install make
- name: Build on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: make linux
- name: Build on Windows
if: matrix.os == 'windows-latest'
run: make windows
- name: Build on macOS
if: matrix.os == 'macos-13'
run: make macos
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.os }}
path: dist/
tag_and_release:
needs: build
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download build artifacts from Linux
uses: actions/download-artifact@v3
with:
name: build-ubuntu-latest
path: dist/linux
- name: Download build artifacts from Windows
uses: actions/download-artifact@v3
with:
name: build-windows-latest
path: dist/windows
- name: Download build artifacts from macOS
uses: actions/download-artifact@v3
with:
name: build-macos-13
path: dist/macos
- name: Create Tag
uses: negz/create-tag@v1
with:
version: ${{ github.event.inputs.tag }}
message: "create tag"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create changelog text
id: changelog
uses: loopwerk/tag-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Print changelog
run: |
cat <<EOF
${{ steps.changelog.outputs.changes }}
EOF
- name: Release & Assets
uses: Hs1r1us/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: Upgit ${{ github.event.inputs.tag }}
body: ${{ steps.changelog.outputs.changes }}
draft: false
prerelease: ${{ github.event.inputs.prerelease }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/**/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true