From 777c8bcf97d8767783600c0bedea63ecd400c5d9 Mon Sep 17 00:00:00 2001 From: licoy Date: Tue, 10 Oct 2023 10:11:49 +0800 Subject: [PATCH] test: macos arm64 build --- .github/workflows/build-macos-arm64.yml | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-macos-arm64.yml diff --git a/.github/workflows/build-macos-arm64.yml b/.github/workflows/build-macos-arm64.yml new file mode 100644 index 0000000..3615ddb --- /dev/null +++ b/.github/workflows/build-macos-arm64.yml @@ -0,0 +1,50 @@ +name: Build for MacOS ARM64 + +on: push + +jobs: + build: + runs-on: macos-11.0-arm64 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.20.2 + + - name: Go tidy + run: go mod tidy + + - name: Install fyne + run: go env -w GOARCH=arm64 && go get fyne.io/fyne/v2/cmd/fyne && go install fyne.io/fyne/v2/cmd/fyne + + - name: Package for MacOS + run: go env -w GOARCH=arm64 && fyne package --release -os darwin + + - name: Compress + uses: a7ul/tar-action@v1.1.0 + id: compress + with: + command: c + files: | + LICENSE + README.md + Fetch-Github-Hosts.app + outPath: fetch-github-hosts_${{ env.RELEASE_VERSION }}_macOS_arm64.tar.gz + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + append_body: true + files: fetch-github-hosts_${{ env.RELEASE_VERSION }}_macOS_arm64.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file