Fix sleep time regression bug #17
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*' | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
lint: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- 'ubuntu-latest' | |
go-version: | |
- '1.22.x' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
version: latest | |
args: --timeout=30m | |
release: | |
runs-on: ${{ matrix.os }} | |
needs: lint | |
strategy: | |
matrix: | |
os: | |
- 'ubuntu-latest' | |
go-version: | |
- '1.22.x' | |
# List of GOOS and GOARCH pairs from `go tool dist list` | |
goosarch: | |
- linux/amd64 | |
- linux/arm64 | |
- windows/amd64 | |
- windows/arm64 | |
- darwin/amd64 | |
- darwin/arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Display Go version | |
run: go version | |
- name: Get OS and arch info | |
run: | | |
GOOSARCH=${{ matrix.goosarch }} | |
GOOS=${GOOSARCH%/*} | |
GOARCH=${GOOSARCH#*/} | |
BINARY_NAME=$(basename $GITHUB_REPOSITORY)-$GOOS-$GOARCH | |
if [[ "$GOOS" == "windows" ]]; then | |
BINARY_NAME=$BINARY_NAME.exe | |
fi | |
echo "BINARY_NAME=$BINARY_NAME" | tee -a $GITHUB_ENV | |
echo "GOOS=$GOOS" | tee -a $GITHUB_ENV | |
echo "GOARCH=$GOARCH" | tee -a $GITHUB_ENV | |
- name: Build | |
run: | | |
go build -o "$BINARY_NAME" -v -ldflags "-H windowsgui -s -w" ./cmd | |
- name: Release Notes | |
run: | |
git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an <%ae>' --no-merges >> ".github/RELEASE-TEMPLATE.md" | |
- name: Release with Notes | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: ".github/RELEASE-TEMPLATE.md" | |
draft: false | |
files: ${{ env.BINARY_NAME }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |