Skip to content

Commit

Permalink
Update build-tag.yml (#61)
Browse files Browse the repository at this point in the history
* Update build-tag.yml

* fix permissions

* bump upload-release-asset-dir to v2

---------

Co-authored-by: zyxkad <[email protected]>
  • Loading branch information
8MiYile and zyxkad authored Apr 23, 2024
1 parent 1d3e365 commit bcde8aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/build-tag.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@

name: Create tagged release

on:
push:
tags:
- 'v*'
on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
-
name: Action Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Setup Golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache-dependency-path: ./go.sum
Expand All @@ -28,13 +25,14 @@ jobs:

create_release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag: ${{ steps.tag.outputs.tag }}
steps:
# -
# name: Action Checkout
# uses: actions/checkout@v3
# uses: actions/checkout@v4
-
name: Output TAG
id: tag
Expand All @@ -45,9 +43,7 @@ jobs:
-
name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
Expand All @@ -70,10 +66,10 @@ jobs:
steps:
-
name: Action Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Setup Golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache-dependency-path: ./go.sum
Expand All @@ -87,7 +83,7 @@ jobs:
run: bash ./scripts/build.sh
-
name: Upload Release Assets
uses: zyxkad/upload-release-asset-dir@v1
uses: zyxkad/upload-release-asset-dir@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -101,10 +97,10 @@ jobs:
steps:
-
name: Action Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Setup Golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache-dependency-path: ./go.sum
Expand All @@ -123,7 +119,7 @@ jobs:
run: go run ./scripts/build-windows.go
-
name: Upload Release Assets
uses: zyxkad/upload-release-asset-dir@v1
uses: zyxkad/upload-release-asset-dir@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -132,12 +128,13 @@ jobs:

build-docker:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- test
steps:
-
name: Action Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Get current tag
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:

jobs:
request:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
-
Expand All @@ -22,9 +25,6 @@ jobs:
run: go generate .
-
name: Go Format
permissions:
issues: write
pull-requests: write
uses: actions/github-script@v7
with:
script: |
Expand Down

0 comments on commit bcde8aa

Please sign in to comment.