Merge pull request #7 from robertranjan/ls-recursively #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
release: | |
name: Build, Test, Check & Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
# - name: Restore Cache | |
# uses: actions/cache@v3 | |
# id: cache | |
# with: | |
# path: ~/go/pkg | |
# key: 1.22-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v5 | |
with: | |
# Require: The version of golangci-lint to use. | |
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. | |
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. | |
version: v1.57 | |
- name: Build | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
# env | |
echo ${{ github.sha }} > Release.txt | |
GOOS=darwin GOARCH=arm64 go build -v -o bin/kpcli_darwin_arm64.bin | |
GOOS=darwin GOARCH=amd64 go build -v -o bin/kpcli_darwin_amd64.bin | |
GOOS=windows GOARCH=amd64 go build -v -o bin/kpcli_windows_amd64.exe | |
GOOS=linux GOARCH=amd64 go build -v -o bin/kpcli_linux_amd64.bin | |
ls -al bin/ | |
- name: Test | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
go test -v ./... | |
cat Release.txt | |
- uses: actions/upload-artifact@v3 | |
name: Publish | |
with: | |
name: kpcli_darwin_arm64.bin | |
path: bin/kpcli_darwin_arm64.bin | |
- uses: actions/upload-artifact@v3 | |
name: Publish | |
with: | |
name: kpcli_darwin_amd64.bin | |
path: bin/kpcli_darwin_amd64.bin | |
- uses: actions/upload-artifact@v3 | |
name: Publish | |
with: | |
name: kpcli_windows_amd64.exe | |
path: bin/kpcli_windows_amd64.exe | |
- uses: actions/upload-artifact@v3 | |
name: Publish | |
with: | |
name: kpcli_linux_amd64.bin | |
path: bin/kpcli_linux_amd64.bin | |
- name: Release with Notes | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
bin/kpcli_darwin_arm64.bin | |
bin/kpcli_darwin_amd64.bin | |
bin/kpcli_windows_amd64.exe | |
bin/kpcli_linux_amd64.bin | |
README.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} |