From c6efeae384500993c52d84f99eb1f7b5e381ccfc Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Wed, 4 Oct 2023 23:06:36 +0800 Subject: [PATCH] Fix: workflow format and init go --- .github/workflows/build.yml | 11 ++++++++--- .github/workflows/release.yml | 21 +++++++++++++-------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4e7348..a64b835 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: build on: push: - branches: [ 'main' ] + branches: ["main"] pull_request: - branches: [ 'main' ] + branches: ["main"] workflow_dispatch: concurrency: @@ -16,10 +16,15 @@ jobs: strategy: matrix: platform: [ubuntu-latest] - go-version: [ '1.21' ] + go-version: ["1.21"] name: Build runs-on: ${{ matrix.platform }} steps: + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d48bc93..7273488 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: release on: push: tags: - - 'v*' + - "v*" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,10 +14,15 @@ jobs: strategy: matrix: platform: [ubuntu-latest] - go-version: [ '1.21' ] + go-version: ["1.21"] name: Release runs-on: ${{ matrix.platform }} steps: + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout uses: actions/checkout@v3 @@ -31,9 +36,9 @@ jobs: - uses: "marvinpinto/action-automatic-releases@latest" with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "v${{ steps.get_version.outputs.VERSION }}" - title: "Version ${{ steps.get_version.outputs.VERSION }}" - prerelease: false - files: | - build/* + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "v${{ steps.get_version.outputs.VERSION }}" + title: "Version ${{ steps.get_version.outputs.VERSION }}" + prerelease: false + files: | + build/*