-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.38 KB
/
build.yml
File metadata and controls
52 lines (42 loc) · 1.38 KB
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
name: Go
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [windows, linux, darwin]
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
- name: Install dependencies
run: go get .
- name: Run tests
run: GOOS=${{ matrix.os }};GOARCH=${{ matrix.arch }}; go test -json > TestResults-${{ matrix.os }}-${{ matrix.arch }}.json
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: Go-Results-${{ matrix.os }}-${{ matrix.arch }}
path: TestResults-${{ matrix.os }}-${{ matrix.arch }}.json
- name: Generate app name
run: echo "app_name=sshconfig-1password" >> $GITHUB_ENV
- name: Add .exe on windows to app name
if: ${{ matrix.os == 'windows' }}
run: echo "app_name=${{ env.app_name }}.exe" >> $GITHUB_ENV
- name: Build
run: GOOS=${{ matrix.os }};GOARCH=${{ matrix.arch }}; go build -ldflags "-X main.gitHash=$GIT_COMMIT" -o ${{ env.app_name }} -v .
- name: Archive build articfacts
uses: actions/upload-artifact@v3
with:
name: sshconfig-1password-${{ matrix.os }}-${{ matrix.arch }}
path: |
${{ env.app_name }}
LICENSE
README.md