From c0ac782dcbfd7ce2ae2bf18d7be5f10a5677fb49 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Sun, 16 Feb 2025 08:38:46 +0100 Subject: [PATCH] build: add release workflow --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..40cb6b3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release +permissions: write-all +on: + push: + tags: + - "v*" + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + os: + - windows + - linux + - darwin + arch: + - amd64 + - arm64 + exclude: + - os: windows + arch: arm64 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.23' + - name: Build binary + run: | + export GOOS=${{ matrix.os }} + export GOARCH=${{ matrix.arch }} + go build -ldflags "-X runtimer/constants.Version=${{ needs.create-tag.outputs.new_tag }}" + - name: Pack binary + run: zip runtimer-${{ matrix.os }}-${{ matrix.arch }}.zip runtimer${{ matrix.os == 'windows' && '.exe' || '' }} + - name: Create release + uses: ncipollo/release-action@v1.15.0 + with: + tag: ${{ needs.create-tag.outputs.new_tag }} + artifacts: holesail-proxy-${{ matrix.os }}-${{ matrix.arch }}.zip + allowUpdates: true