Skip to content

Commit f755eff

Browse files
authored
Create go.yml
1 parent b0cfe1c commit f755eff

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/go.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release on commit or tag
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release/*
7+
create:
8+
tags:
9+
- v*
10+
jobs:
11+
build:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Set up Go 1.13
16+
uses: actions/setup-go@v1
17+
with:
18+
go-version: 1.13
19+
20+
- name: Check out source code
21+
uses: actions/checkout@master
22+
23+
- name: Build OS X binary
24+
run: GOOS=darwin GOARCH=amd64 go build -o $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)-darwin64 -a -ldflags '-s -w' .
25+
26+
- name: Build Linux binary
27+
run: GOOS=linux GOARCH=amd64 go build -o $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)-linux64 -a -ldflags '-s -w' .
28+
29+
- name: Build ARM binary
30+
run: GOOS=linux GOARCH=arm GOARM=6 go build -o $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)-arm -a -ldflags '-s -w' .
31+
32+
- name: Build windows binary
33+
run: GOOS=windows GOARCH=amd64 go build -o $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2).exe -a -ldflags '-s -w' .
34+
35+
- name: Install olsu
36+
run: wget https://github.com/Telling/olsu/releases/download/v0.1.0/olsu-linux-amd64.zip && unzip olsu-linux-amd64.zip && chmod +x olsu-linux-amd64 && pwd && ls -la
37+
38+
- name: Create or update release
39+
env:
40+
OLSU_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
OLSU_DELETE_RELEASE: yes
42+
run: ./olsu-linux-amd64 -o $(echo $GITHUB_REPOSITORY | cut -d "/" -f 1) -r $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2) "Latest release" "latest" "Automatic release" $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)-darwin64 $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)-linux64 $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)-arm # $(echo $GITHUB_REPOSITORY | cut -d "/" -f 2).exe

0 commit comments

Comments
 (0)