Skip to content

Commit 9339e2d

Browse files
committed
Added github actions
1 parent f6b7a51 commit 9339e2d

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on: [push, pull_request]
2+
name: Test
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
go-version: [1.16.x, 1.x]
8+
os: [ubuntu-latest]
9+
arch: ["", "386"]
10+
fail-fast: false
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- name: Install Go
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: ${{ matrix.go-version }}
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
- name: Run tests
20+
env:
21+
GOARCH: ${{ matrix.arch }}
22+
run: go test ./...

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
release:
3+
types: [created]
4+
5+
jobs:
6+
releases-matrix:
7+
name: Release Go Binary
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
goos: [linux, darwin]
12+
goarch: [amd64, arm64, arm]
13+
exclude:
14+
- goarch: arm
15+
goos: darwin
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: wangyoucao577/go-release-action@v1.20
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
goos: ${{ matrix.goos }}
22+
goarch: ${{ matrix.goarch }}
23+
project_path: "./diskrsync"
24+
binary_name: "diskrsync"

0 commit comments

Comments
 (0)