Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuan committed May 16, 2024
1 parent 97e78a6 commit 9795cc0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: '1.21.1'
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.55.2
- name: Build
run: make build-all
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- run: make compress-linux
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/securebin*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build-linux:
GOOS=linux GOARCH=amd64 go build -o bin/securebin_linux-amd64 -ldflags "-s -w"

build-windows:
GOOS=windows GOARCH=amd64 go build -o bin/securebin_windows-amd64 -ldflags "-s -w"
GOOS=windows GOARCH=amd64 go build -o bin/securebin_windows-amd64 -ldflags "-s -w"

build-all: clean build-macos build-linux build-windows

Expand Down

0 comments on commit 9795cc0

Please sign in to comment.