Skip to content

Commit

Permalink
Set up CI and publishing (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScorpion authored Dec 8, 2023
1 parent 98e4057 commit ed09da8
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build

on: push

jobs:
build:
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- run: test -z $(gofmt -l .)
- run: go build ./cmd/explainshell.go
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish

on:
push:
tags:
- "v*.*.*"

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
include:
- goos: linux
goarch: amd64
filename: explainshell-linux-amd64
- goos: darwin
goarch: amd64
filename: explainshell-darwin-amd64
- goos: darwin
goarch: arm64
goarm: 7
filename: explainshell-darwin-arm7
- goos: windows
goarch: amd64
filename: explainshell-windows-amd64.exe
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- run: go build -o ${{ matrix.filename }} ./cmd/explainshell.go
- uses: softprops/action-gh-release@v1
with:
files: explainshell-*
generate_release_notes: true
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module explainshell-shell

go 1.17
go 1.21

require github.com/PuerkitoBio/goquery v1.8.0

Expand Down

0 comments on commit ed09da8

Please sign in to comment.