-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (77 loc) · 3.11 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (77 loc) · 3.11 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
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
name: Release
on:
push:
tags:
- 'v*'
branches:
- main
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.0'
- run: go version
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build for Linux AMD64
run: |
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build \
-ldflags "-s -w -X github.com/linpr/lazyssh/cmd.version=${{ steps.get_version.outputs.VERSION }} -X github.com/linpr/lazyssh/cmd.commit=$(git rev-parse --short HEAD)" \
-o lazyssh-linux-amd64 ./cmd/
- name: Build for Linux ARM64
run: |
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build \
-ldflags "-s -w -X github.com/linpr/lazyssh/cmd.version=${{ steps.get_version.outputs.VERSION }} -X github.com/linpr/lazyssh/cmd.commit=$(git rev-parse --short HEAD)" \
-o lazyssh-linux-arm64 ./cmd/
- name: Build for Windows AMD64
run: |
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build \
-ldflags "-s -w -X github.com/linpr/lazyssh/cmd.version=${{ steps.get_version.outputs.VERSION }} -X github.com/linpr/lazyssh/cmd.commit=$(git rev-parse --short HEAD)" \
-o lazyssh-windows-amd64.exe ./cmd/
- name: Build for Windows ARM64
run: |
GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build \
-ldflags "-s -w -X github.com/linpr/lazyssh/cmd.version=${{ steps.get_version.outputs.VERSION }} -X github.com/linpr/lazyssh/cmd.commit=$(git rev-parse --short HEAD)" \
-o lazyssh-windows-arm64.exe ./cmd/
- name: Build for macOS AMD64
run: |
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build \
-ldflags "-s -w -X github.com/linpr/lazyssh/cmd.version=${{ steps.get_version.outputs.VERSION }} -X github.com/linpr/lazyssh/cmd.commit=$(git rev-parse --short HEAD)" \
-o lazyssh-darwin-amd64 ./cmd/
- name: Build for macOS ARM64
run: |
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build \
-ldflags "-s -w -X github.com/linpr/lazyssh/cmd.version=${{ steps.get_version.outputs.VERSION }} -X github.com/linpr/lazyssh/cmd.commit=$(git rev-parse --short HEAD)" \
-o lazyssh-darwin-arm64 ./cmd/
- name: Create checksums
run: |
sha256sum lazyssh-* > checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
files: |
lazyssh-linux-amd64
lazyssh-linux-arm64
lazyssh-windows-amd64.exe
lazyssh-windows-arm64.exe
lazyssh-darwin-amd64
lazyssh-darwin-arm64
checksums.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}