🎉 Build Binary #44
Workflow file for this run
This file contains hidden or 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: 🎉 Build Binary | |
on: | |
create: | |
tags: | |
- v* | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- macos-13 | |
- macos-14 | |
steps: | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.23 | |
id: go | |
- name: Set up dependencies on Ubuntu | |
if: matrix.os == 'ubuntu-20.04' | |
run: sudo apt-get update && sudo apt-get install libpcap-dev gcc zip -y | |
- name: Install zip on macOS | |
if: runner.os == 'macOS' | |
run: brew install zip | |
- name: Get version | |
id: get_version | |
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
- 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 -o ./ksubdomain ./cmd/ksubdomain/ | |
chmod +x ksubdomain | |
zip KSubdomain-${{ steps.get_version.outputs.VERSION }}-linux-amd64.zip ksubdomain | |
if: matrix.os == 'ubuntu-20.04' | |
env: | |
GOENABLE: 1 | |
CGO_LDFLAGS: "-Wl,-static -L/usr/lib/x86_64-linux-gnu/libpcap.a -lpcap -Wl,-Bdynamic" | |
- name: Build On Darwin amd64 | |
run: | | |
go build -o ./ksubdomain ./cmd/ksubdomain/ | |
chmod +x ksubdomain | |
zip KSubdomain-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.zip ksubdomain | |
if: matrix.os == 'macos-13' | |
env: | |
GOOS: darwin | |
GOARCH: amd64 | |
- name: Build On Darwin arm64 | |
run: | | |
go build -o ./ksubdomain ./cmd/ksubdomain/ | |
chmod +x ksubdomain | |
zip KSubdomain-${{ steps.get_version.outputs.VERSION }}-darwin-arm64.zip ksubdomain | |
if: matrix.os == 'macos-14' | |
env: | |
GOOS: darwin | |
GOARCH: arm64 | |
- name: Build On Windows | |
run: | | |
go build -o ./ksubdomain.exe ./cmd/ksubdomain/ | |
zip KSubdomain-windows.zip ksubdomain.exe | |
if: matrix.os == 'ubuntu-20.04' | |
env: | |
GOOS: windows | |
GOENABLE: 1 | |
- name: Release | |
uses: softprops/action-gh-release@master | |
with: | |
# note you'll typically need to create a personal access token | |
# with permissions to create releases in the other repo | |
files: KSubdomain-*.zip | |
fail_on_unmatched_files: true | |
token: ${{ secrets.TOKEN }} | |
append_body: true | |
env: | |
GITHUB_REPOSITORY: boy-hack/ksubdomain |