diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index b072a3ab..b5c6e64a 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -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/ \ No newline at end of file + args: release -f .goreleaser/windows.yml --rm-dist + workdir: v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/v2/.goreleaser.yml b/v2/.goreleaser.yml deleted file mode 100644 index 35f92590..00000000 --- a/v2/.goreleaser.yml +++ /dev/null @@ -1,32 +0,0 @@ -before: - hooks: - - go mod tidy - -builds: -- env: - - CGO_ENABLED=0 - goos: - - windows - - linux - - darwin - - goarch: - - amd64 - - 386 - - arm - - arm64 - - ignore: - - goos: darwin - goarch: '386' - - binary: '{{ .ProjectName }}' - main: cmd/naabu/main.go - -archives: -- format: zip - replacements: - darwin: macOS - -checksum: - algorithm: sha256 \ No newline at end of file diff --git a/v2/.goreleaser/linux.yml b/v2/.goreleaser/linux.yml new file mode 100644 index 00000000..94bf9cce --- /dev/null +++ b/v2/.goreleaser/linux.yml @@ -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" diff --git a/v2/.goreleaser/mac.yml b/v2/.goreleaser/mac.yml new file mode 100644 index 00000000..925bbf80 --- /dev/null +++ b/v2/.goreleaser/mac.yml @@ -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" diff --git a/v2/.goreleaser/windows.yml b/v2/.goreleaser/windows.yml new file mode 100644 index 00000000..4a5071e1 --- /dev/null +++ b/v2/.goreleaser/windows.yml @@ -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"