-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.67 KB
/
Copy pathrelease.yml
File metadata and controls
79 lines (66 loc) · 2.67 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
name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: go test ./...
- name: Semantic release
id: semrel
uses: go-semantic-release/action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build binaries
if: steps.semrel.outputs.version != ''
run: |
mkdir -p dist
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o dist/git-owl-darwin-arm64
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/git-owl-darwin-amd64
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/git-owl-linux-amd64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o dist/git-owl-linux-arm64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o dist/git-owl-windows-amd64.exe
- name: Upload assets and install instructions
if: steps.semrel.outputs.version != ''
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.semrel.outputs.version }}
append_body: true
body: |
## Install
**macOS (Apple Silicon)**
```bash
curl -Lo git-owl https://github.com/AdrianClyde/git-owl/releases/download/v${{ steps.semrel.outputs.version }}/git-owl-darwin-arm64
chmod +x git-owl && sudo mv git-owl /usr/local/bin/
```
**macOS (Intel)**
```bash
curl -Lo git-owl https://github.com/AdrianClyde/git-owl/releases/download/v${{ steps.semrel.outputs.version }}/git-owl-darwin-amd64
chmod +x git-owl && sudo mv git-owl /usr/local/bin/
```
**Linux (x86_64)**
```bash
curl -Lo git-owl https://github.com/AdrianClyde/git-owl/releases/download/v${{ steps.semrel.outputs.version }}/git-owl-linux-amd64
chmod +x git-owl && sudo mv git-owl /usr/local/bin/
```
**Linux (ARM64)**
```bash
curl -Lo git-owl https://github.com/AdrianClyde/git-owl/releases/download/v${{ steps.semrel.outputs.version }}/git-owl-linux-arm64
chmod +x git-owl && sudo mv git-owl /usr/local/bin/
```
**Windows (x86_64)**
```powershell
Invoke-WebRequest -Uri https://github.com/AdrianClyde/git-owl/releases/download/v${{ steps.semrel.outputs.version }}/git-owl-windows-amd64.exe -OutFile git-owl.exe
```
files: dist/*