From c5f05429a64f11ed39d1a838ee367e48bd1012e1 Mon Sep 17 00:00:00 2001 From: allo Date: Thu, 5 May 2022 16:06:08 +0800 Subject: [PATCH] build(ci): update dependencies --- .github/workflows/Build.yml | 15 +++++++-------- .github/workflows/Release.yml | 36 +++-------------------------------- 2 files changed, 10 insertions(+), 41 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index b1ab588..a971051 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -1,15 +1,17 @@ name: build on: push: - branches: [ main ] + branches: [ v1 ] paths-ignore: - '.**' + - '!.github/workflows/Build.yml' - 'LICENSE' - 'README.md' pull_request: - branches: [ main ] + branches: [ v1 ] paths-ignore: - '.**' + - '!.github/workflows/Build.yml' - 'LICENSE' - 'README.md' @@ -18,17 +20,14 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - name: Set GoVersion - run: | - echo "GoVersion=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oEm 1 '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | cut -d':' -f2 | sed 's/ //g; s/"//g')" >> ${GITHUB_ENV} - - name: Check out code uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: ${{ env.GoVersion }} + go-version: '^1.17' + check-latest: true - name: Download dependency run: go mod download diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index d7b5937..956240f 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -1,35 +1,13 @@ name: Release on: - workflow_dispatch: - inputs: - VERSION: - description: 'version(vX.Y.Z) to release' - required: true - default: 'v' - MESSAGE: - description: 'message for release body' - GoVersion: - description: > - Go version(X.Y.Z) for build - default: latest go version release: types: [published] -env: - MESSAGE: ${{ github.event.inputs.MESSAGE }} - VERSION: ${{ github.event.inputs.VERSION }} - GoVersion: ${{ github.event.inputs.GoVersion }} - jobs: release: name: Release on GitHub runs-on: ubuntu-latest steps: - - name: Set GoVersion - if: env.GoVersion == '' - run: | - echo "GoVersion=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oEm 1 '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | cut -d':' -f2 | sed 's/ //g; s/"//g')" >> ${GITHUB_ENV} - - name: Set ENV for 'Create Tag' if: startsWith(github.ref, 'refs/tags/') run: | @@ -39,9 +17,10 @@ jobs: uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: ${{ env.GoVersion }} + go-version: '^1.17' + check-latest: true - name: Download dependency run: go mod download @@ -57,15 +36,6 @@ jobs: wait $build1 wait $build2 - - name: Create Release - if: github.event_name != 'release' - run: | - gh release create ${{ env.VERSION }} -n "${{ env.MESSAGE }}" -t "${{ env.name }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # attribute - name: 健康打卡_函数计算版${{ env.VERSION }} - - name: Upload Assets run: | gh release upload ${{ env.VERSION }} *.zip --clobber