Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 57 additions & 14 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,68 @@ on:
- v*
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: "Check out code"
jobs:
build-mac:
runs-on: macos-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
with:
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Install Dependences
run: brew install libpcap
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release -f .goreleaser/mac.yml --rm-dist
workdir: v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Set up Go"
build-linux:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
with:
go-version: 1.16
- name: Install Dependences
run: sudo apt install libpcap-dev

- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: "Create release on GitHub"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release -f .goreleaser/linux.yml --rm-dist
workdir: v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-windows:
runs-on: windows-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
args: "release --rm-dist"
with:
version: latest
workdir: v2/
args: release -f .goreleaser/windows.yml --rm-dist
workdir: v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 0 additions & 32 deletions v2/.goreleaser.yml

This file was deleted.

23 changes: 23 additions & 0 deletions v2/.goreleaser/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
project_name: naabu
builds:
- id: naabu-linux
ldflags:
- -s -w
binary: naabu
env:
- CGO_ENABLED=1
main: ./cmd/naabu/main.go
goos:
- linux
goarch:
- amd64
archives:
- format: zip

checksum:
name_template: "{{ .ProjectName }}-linux-checksums.txt"
26 changes: 26 additions & 0 deletions v2/.goreleaser/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
project_name: naabu
builds:
- id: naabu-darwin
ldflags:
- -s -w
binary: naabu
env:
- CGO_ENABLED=1
main: ./cmd/naabu/main.go
goos:
- darwin
goarch:
- amd64

archives:
- format: zip
replacements:
darwin: macOS

checksum:
name_template: "{{ .ProjectName }}-mac-checksums.txt"
29 changes: 29 additions & 0 deletions v2/.goreleaser/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
project_name: naabu
builds:
- id: naabu-windows
ldflags:
- -s -w
binary: naabu
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
main: ./cmd/naabu/main.go
goos:
- windows
goarch:
- amd64
- 386
- arm
- arm64

archives:
- format: zip

checksum:
name_template: "{{ .ProjectName }}-windows-checksums.txt"