From 4fee5d6d1c5a37e721836b4c76ffff4599e605d7 Mon Sep 17 00:00:00 2001 From: Hong Xiaojian Date: Sat, 8 Oct 2022 20:35:48 +0800 Subject: [PATCH] fix --- .github/workflows/release.yaml | 50 +++++++++++++++++++++++++++++++--- Makefile | 4 +-- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c128b99..2545b52 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,7 @@ on: default: 'warning' jobs: build-linux-amd64: - name: Build Linux binaries + name: Build Linux x86-64 binary runs-on: ubuntu-latest env: GOVER: 1.19 @@ -33,7 +33,7 @@ jobs: name: yomo-artifact path: ./bin/**/* build-linux-arm64: - name: Build Linux arm64 binaries + name: Build Linux arm64 binary runs-on: [self-hosted, Linux, ARM64] env: GOVER: 1.19 @@ -57,10 +57,52 @@ jobs: with: name: yomo-artifact path: ./bin/**/* + build-darwin-amd64: + name: Build MacOS x86-64 binary + runs-on: macos-latest + env: + GOVER: 1.19 + steps: + - name: Set up Go ${{ env.GOVER }} + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GOVER }} + - name: Check out code + uses: actions/checkout@v3 + - name: Run go mod tidy + run: go mod tidy + - name: build & archive binaries + run: make archive-release-darwin-amd64 + - name: upload artifacts + uses: actions/upload-artifact@master + with: + name: yomo-artifact + path: ./bin/**/* + build-windows-amd64: + name: Build Windows x86-64 binary + runs-on: windows-latest + env: + GOVER: 1.19 + steps: + - name: Set up Go ${{ env.GOVER }} + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GOVER }} + - name: Check out code + uses: actions/checkout@v3 + - name: Run go mod tidy + run: go mod tidy + - name: build & archive binaries + run: | + make archive-release-windows-amd64 + - name: upload artifacts + uses: actions/upload-artifact@master + with: + name: yomo-artifact + path: ./bin/**/* publish: name: Publish binaries - # needs: [build-linux, build-darwin, build-windows] - needs: [build-linux-amd64] + needs: [build-linux-amd64, build-linux-arm64, build-darwin-amd64, build-windows-amd64] env: ARTIFACT_DIR: ./release runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 7b09a93..d78a0b8 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ archive-release-linux-amd64: rm -rf bin/yomo GOARCH=amd64 GOOS=linux $(GO) build -o bin/yomo -ldflags "-s -w ${GO_LDFLAGS}" ./yomo/main.go tar -C ./bin -czf bin/yomo-${VER}-x86_64-Linux.tar.gz yomo + make bina archive-release-linux-arm64: rm -rf bin/yomo @@ -59,8 +60,7 @@ archive-release-darwin-arm64: tar -C ./bin -czf bin/yomo-${VER}-arm64-Darwin.tar.gz yomo archive-release-windows-amd64: - rm -rf bin/yomo - GOARCH=amd64 GOOS=windows $(GO) build -o bin/yomo.exe -ldflags "-s -w ${GO_LDFLAGS}" ./yomo/main.go + $(GO) build -o bin/yomo.exe -ldflags "-s -w ${GO_LDFLAGS}" ./yomo/main.go tar -C ./bin -czf bin/yomo-${VER}-x86_64-Windows.tar.gz yomo.exe build-w-sym: