Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
build(ci): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
yin1999 committed May 5, 2022
1 parent 197f0d3 commit c5f0542
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 41 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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
Expand Down
36 changes: 3 additions & 33 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c5f0542

Please sign in to comment.