From 25c6b2ce13b2b431432c60dd690ddf0f3fda846c Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Wed, 1 May 2024 08:39:52 +0000 Subject: [PATCH] update --- .github/workflows/go.yaml | 20 ------ .github/workflows/{release.yaml => main.yaml} | 67 +++++++++---------- 2 files changed, 30 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/go.yaml rename .github/workflows/{release.yaml => main.yaml} (58%) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml deleted file mode 100644 index b8ad002..0000000 --- a/.github/workflows/go.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Go - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 'stable' - - name: Build - run: go build -v ./... - - name: Test - run: go test -v ./... \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/main.yaml similarity index 58% rename from .github/workflows/release.yaml rename to .github/workflows/main.yaml index c47bed9..44bb951 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/main.yaml @@ -1,30 +1,45 @@ -name: Release +name: Build and Release on: + push: + branches: [ main ] + pull_request: + branches: [ main ] release: types: [published] jobs: - releases-matrix: + build: + name: Build and Test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 'stable' + + - name: Build and Test on Default Platform + run: | + go build -v ./... + go test -v ./... + + release-binary: name: Release Go Binary runs-on: ubuntu-latest + needs: build strategy: matrix: - # Include amd64 on all platforms. - goos: [windows, freebsd, openbsd, linux, dragonfly, darwin] + goos: [windows, freebsd, openbsd, linux, darwin] goarch: [amd64, 386] exclude: - # Exclude i386 on darwin and dragonfly. - - goarch: 386 - goos: dragonfly - goarch: 386 goos: darwin include: - # BEIGIN MacOS ARM64 - goos: darwin goarch: arm64 - # END macOS ARM64 - # BEGIN Linux ARM 5 6 7 - goos: linux goarch: arm goarm: 7 @@ -34,25 +49,17 @@ jobs: - goos: linux goarch: arm goarm: 5 - # END Linux ARM 5 6 7 - # BEGIN Android ARM 8 - goos: android goarch: arm64 - # END Android ARM 8 - # Windows ARM - goos: windows goarch: arm64 - goos: windows goarch: arm goarm: 7 - # BEGIN Other architectures - # BEGIN riscv64 & ARM64 - goos: linux goarch: arm64 - goos: linux goarch: riscv64 - # END riscv64 & ARM64 - # BEGIN MIPS - goos: linux goarch: mips64 - goos: linux @@ -67,26 +74,15 @@ jobs: - goos: linux goarch: mips gomips: softfloat - # END MIPS - # BEGIN PPC - goos: linux goarch: ppc64 - goos: linux goarch: ppc64le - # END PPC - # BEGIN FreeBSD ARM - goos: freebsd goarch: arm64 - goos: freebsd goarch: arm goarm: 7 - # END FreeBSD ARM - # BEGIN S390X - - goos: linux - goarch: s390x - # END S390X - # END Other architectures - # BEGIN OPENBSD ARM - goos: openbsd goarch: arm64 - goos: openbsd @@ -99,11 +95,8 @@ jobs: GOMIPS: ${{ matrix.gomips }} CGO_ENABLED: 0 steps: - - uses: actions/checkout@v3 - - uses: wangyoucao577/go-release-action@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - asset_name: backtrace-${{ matrix.goos }}-${{ matrix.goarch }} - ldflags: -s -w \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v3 + - name: Release Go Binary + run: | + go build -o backtrace-${{ matrix.goos }}-${{ matrix.goarch }} -v ./...