-
Notifications
You must be signed in to change notification settings - Fork 33
77 lines (66 loc) · 1.74 KB
/
push.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
name: PR Workflow
on:
push:
branches:
- master
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- os: linux
arch: "amd64"
- os: linux
arch: "arm64"
- os: darwin
arch: "amd64"
- os: darwin
arch: "arm64"
- os: windows
arch: "386"
- os: windows
arch: "amd64"
name: Build and save artifact
steps:
- uses: actions/checkout@v2
- name: Install dependencies
uses: actions/setup-go@v3
with:
go-version: v1.21
- name: Set .exe extension for Windows
run: echo "EXTENSION=.exe" >> $GITHUB_ENV
if: matrix.target.os == 'windows'
- name: Set executable filename
run: echo "FILENAME=sshs-${{ matrix.target.os }}-${{ matrix.target.arch }}${{ env.EXTENSION }}" >> $GITHUB_ENV
- name: Build
run: make build OUTPUT=bin/${{ env.FILENAME }}
env:
GOOS: "${{ matrix.target.os }}"
GOARCH: "${{ matrix.target.arch }}"
- uses: actions/upload-artifact@v2
with:
name: ${{ env.FILENAME }}
path: bin/${{ env.FILENAME }}
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix build
- run: nix flake check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: v1.21
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest