From 8d0341696e22356abf41f4c7b125ef0c8f8d3635 Mon Sep 17 00:00:00 2001 From: "simple.max" Date: Wed, 28 Sep 2022 10:36:07 +0200 Subject: [PATCH] setup CI-CD --- .github/workflows/release.yaml | 35 +++++++++++++++++++++++ .goreleaser.yaml | 51 ++++++++++++++++++++++++++++++++++ README.md | 6 ++-- 3 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c92135b --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,35 @@ +name: release +on: + push: + tags: + - v* + +env: + GO_VERSION: 1.19 + +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + - uses: actions/cache@v3 + if: ${{ !env.ACT }} + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..68b8c7e --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,51 @@ +before: + hooks: + - go mod tidy +builds: + - main: ./cmd/godown/main.go + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - "386" + - arm + - arm64 + goarm: + - "6" + - "7" + ignore: + - goos: windows + goarch: "6" +archives: + - name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + format_overrides: + - goos: windows + format: zip +checksum: + name_template: "checksums.txt" +changelog: + groups: + - title: "New Features" + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: "Bug fixes" + regexp: "^.*fix[(\\w)]*:+.*$" + order: 1 + - title: "Documentation updates" + regexp: "^.*docs[(\\w)]*:+.*$" + order: 2 + - title: "Other" + order: 999 +release: + prerelease: auto + mode: append diff --git a/README.md b/README.md index 7bea182..4096c0b 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ Will work on this list when I got some free time. If you want to contribute, fee - [ ] UDP flood attack. - [ ] Add support for connecting multiple applications (ddos) and attack the same host. - [ ] Move necessary code to /pkg. -- [ ] Add binary for windows. -- [ ] Add binary for linux. -- [ ] Add binary for mac. +- [x] Add binary for windows. +- [x] Add binary for linux. +- [x] Add binary for mac. # Attacks