From cade3d2c7dcc40e871c1cd5f2abe30bbef741dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Agostinho=20de=20Sousa?= Date: Wed, 19 Aug 2026 15:58:54 +0200 Subject: [PATCH] Add github workflow --- .github/workflow/release.yml | 83 ++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflow/release.yml diff --git a/.github/workflow/release.yml b/.github/workflow/release.yml new file mode 100644 index 0000000..15c7cc5 --- /dev/null +++ b/.github/workflow/release.yml @@ -0,0 +1,83 @@ +name: Release + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + build: + name: Build ${{ matrix.name }} + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - goos: linux + goarch: amd64 + name: linux-amd64 + extension: "" + + - goos: linux + goarch: arm64 + name: linux-arm64 + extension: "" + + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Go + uses: actions/setup-go@v7 + with: + go-version: stable + + - name: Build + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + CGO_ENABLED: 0 + VERSION: ${{ github.ref_name }} + run: | + mkdir -p dist + go build \ + -ldflags="-X main.version=${VERSION}" \ + -o "dist/findbaseport-${{ matrix.name }}${{ matrix.extension }}" \ + . + + - name: Upload binary artifact + uses: actions/upload-artifact@v7 + with: + name: findbaseport-${{ matrix.name }} + path: dist/findbaseport-${{ matrix.name }}${{ matrix.extension }} + archive: false + + release: + name: Create release + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download binaries + uses: actions/download-artifact@v8 + with: + pattern: findbaseport-* + path: dist + merge-multiple: true + + - name: Generate checksums + working-directory: dist + run: | + sha256sum * > checksums.txt + + - name: Create GitHub Release + uses: softprops/action-gh-release@v3 + with: + generate_release_notes: true + files: | + dist/findbaseport-* + dist/checksums.txt +