diff --git a/.github/workflows/go-releaser.yml b/.github/workflows/go-releaser.yml new file mode 100644 index 0000000..7d8bf4c --- /dev/null +++ b/.github/workflows/go-releaser.yml @@ -0,0 +1,32 @@ +name: go-releaser + +permissions: + contents: write + id-token: write + packages: write + +on: + push: + tags: [ 'v*' ] + +jobs: + goreleaser: + runs-on: ubuntu-latest + env: + flags: '' + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.21 + cache: true + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --clean ${{ env.flags }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..f06dfb4 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,43 @@ +project_name: go-port-forward + +before: + hooks: + - go mod tidy + +builds: + - binary: go-port-forward + main: . + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + - arm64 + +checksum: + name_template: "checksums.txt" + +archives: + - name_template: >- + {{ .ProjectName }}_ + {{- .Version }}_ + {{- if eq .Os "darwin" }}macos_ + {{- else }}{{ .Os }}_{{ end }} + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else if eq .Arch "arm64" }}aarch64 + {{- else if eq .Arch "arm" }}armv{{ .Arm }} + {{- else }}{{ .Arch }}{{ end }} + wrap_in_directory: true + format_overrides: + - goos: windows + format: zip + builds_info: + group: root + owner: root + files: + - README.md + - LICENSE + - monitor.sh + - config-simple.yaml