Skip to content

🎉 Build Binary

🎉 Build Binary #3

Workflow file for this run

name: 🎉 Build Binary
permissions:
contents: write
on:
create:
tags:
- v*
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.20.x
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: go mod download
- name: Build On Linux
run: |
go build -ldflags "-s -w" -o Jie-Linux-x64 main.go
chmod +x Jie-Linux-x64
if: matrix.os == 'ubuntu-latest'
- name: Build On Darwin
run: |
go build -ldflags "-s -w" -o Jie-Darwin-x64 main.go
chmod +x Jie-Darwin-x64
if: matrix.os == 'macos-latest'
- name: Build On Windows
run: |
go build -ldflags "-s -w" -o Jie-Windows-x64.exe main.go
if: matrix.os == 'windows-latest'
env:
GOOS: windows
GOENABLE: 1
- name: Release
uses: softprops/action-gh-release@master
with:
files: Jie-*
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"