Skip to content

Commit

Permalink
feat: Support publishing hgctl packages to GitHub releases
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3CHO committed Mar 13, 2024
1 parent d64c266 commit 91b11f5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release-hgctl.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 91b11f5

Please sign in to comment.