From 91b11f5eb61cdedcee3ef915899b626331d10570 Mon Sep 17 00:00:00 2001 From: CH3CHO Date: Wed, 13 Mar 2024 10:20:13 +0800 Subject: [PATCH] feat: Support publishing hgctl packages to GitHub releases --- .github/workflows/release-hgctl.yaml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release-hgctl.yaml diff --git a/.github/workflows/release-hgctl.yaml b/.github/workflows/release-hgctl.yaml new file mode 100644 index 0000000000..60593a7afb --- /dev/null +++ b/.github/workflows/release-hgctl.yaml @@ -0,0 +1,35 @@ +name: Release hgctl to GitHub + +on: + push: + tags: + - "v*.*.*" + workflow_dispatch: ~ + +jobs: + release-hgctl: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build hgctl latest multiarch binaries + run: | + GOPROXY="https://proxy.golang.org,direct" make build-hgctl-multiarch + tar -zcvf hgctl_${{ github.ref }}_linux_amd64.tar.gz out/linux_amd64/ + tar -zcvf hgctl_${{ github.ref }}_linux_arm64.tar.gz out/linux_arm64/ + tar -zcvf hgctl_${{ github.ref }}_darwin_amd64.tar.gz out/darwin_amd64/ + tar -zcvf hgctl_${{ github.ref }}_darwin_arm64.tar.gz out/darwin_arm64/ + zip -q -r hgctl_${{ github.ref }}_windows_amd64.zip out/windows_amd64/ + zip -q -r hgctl_${{ github.ref }}_windows_arm64.zip out/windows_arm64/ + + - name: Recreate the Latest Release and Tag + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + hgctl_${{ github.ref }}_linux_amd64.tar.gz + hgctl_${{ github.ref }}_linux_arm64.tar.gz + hgctl_${{ github.ref }}_darwin_amd64.tar.gz + hgctl_${{ github.ref }}_darwin_arm64.tar.gz + hgctl_${{ github.ref }}_windows_amd64.zip + hgctl_${{ github.ref }}_windows_arm64.zip \ No newline at end of file