From e3a7c242d8d93be9f6c6d42f4041eff661c34fe0 Mon Sep 17 00:00:00 2001 From: sincerefly Date: Wed, 10 Apr 2024 11:49:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=20github=20actio?= =?UTF-8?q?n=20=E8=87=AA=E5=8A=A8=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ scripts/xcompile.sh | 13 +++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 scripts/xcompile.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3128a02 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release EasyCmd +on: + push: + tags: + - 'v0.*' + - 'draft-*' + +jobs: + publishGitRelease: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '^1.20' + check-latest: true + + - name: Cross compile + run: | + sudo apt-get install rhash -y + go install github.com/mitchellh/gox@v1.0.1 + mkdir -p build + ./scripts/xcompile.sh + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: build/* + draft: true + fail_on_unmatched_files: true diff --git a/scripts/xcompile.sh b/scripts/xcompile.sh new file mode 100644 index 0000000..9787b2d --- /dev/null +++ b/scripts/xcompile.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e +# you may need to go install github.com/mitchellh/gox@v1.0.1 first +echo $VERSION +CGO_ENABLED=0 gox -ldflags "-s -w ${LDFLAGS}" -output="build/easycmd_{{.OS}}_{{.Arch}}" --osarch="darwin/amd64 darwin/arm64 linux/386 linux/amd64 linux/arm linux/arm64" + +cd build + +rhash -r -a . -o checksums + +rhash -r -a --bsd . -o checksums-bsd + +rhash --list-hashes > checksums_hashes_order From 0e3f755baa1a272676e7809947b5590659cbc189 Mon Sep 17 00:00:00 2001 From: sincerefly Date: Wed, 10 Apr 2024 11:54:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=B8=BA=20xcompile.sh=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E6=B7=BB=E5=8A=A0=E5=8F=AF=E6=89=A7=E8=A1=8C=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/xcompile.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/xcompile.sh diff --git a/scripts/xcompile.sh b/scripts/xcompile.sh old mode 100644 new mode 100755