Skip to content

Commit ed09da8

Browse files
authored
Set up CI and publishing (#5)
1 parent 98e4057 commit ed09da8

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
env:
9+
CGO_ENABLED: 0
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-go@v4
13+
with:
14+
go-version: '1.21'
15+
- run: test -z $(gofmt -l .)
16+
- run: go build ./cmd/explainshell.go

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
strategy:
14+
matrix:
15+
include:
16+
- goos: linux
17+
goarch: amd64
18+
filename: explainshell-linux-amd64
19+
- goos: darwin
20+
goarch: amd64
21+
filename: explainshell-darwin-amd64
22+
- goos: darwin
23+
goarch: arm64
24+
goarm: 7
25+
filename: explainshell-darwin-arm7
26+
- goos: windows
27+
goarch: amd64
28+
filename: explainshell-windows-amd64.exe
29+
env:
30+
CGO_ENABLED: 0
31+
GOOS: ${{ matrix.goos }}
32+
GOARCH: ${{ matrix.goarch }}
33+
GOARM: ${{ matrix.goarm }}
34+
steps:
35+
- uses: actions/checkout@v3
36+
- uses: actions/setup-go@v4
37+
with:
38+
go-version: '1.21'
39+
- run: go build -o ${{ matrix.filename }} ./cmd/explainshell.go
40+
- uses: softprops/action-gh-release@v1
41+
with:
42+
files: explainshell-*
43+
generate_release_notes: true

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module explainshell-shell
22

3-
go 1.17
3+
go 1.21
44

55
require github.com/PuerkitoBio/goquery v1.8.0
66

0 commit comments

Comments
 (0)