feat: publish protocol IDL as release asset
This commit is contained in:
1 parent
40319ff244
commit
bd000d23c9
1 file changed
+37
@@ -0,0 +1,37 @@
|
||||
name: Release assets
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 要上传附件的 Release tag
|
||||
required: true
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: release-assets-${{ github.event.release.tag_name || inputs.tag }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
idl:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
TAG: ${{ github.event.release.tag_name || inputs.tag }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: refs/tags/${{ env.TAG }}
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: go run ./cmd/protocolgen -check
|
||||
- run: gh release upload "$TAG" protocol/idl.json --clobber
|
||||
- run: gh release download "$TAG" --pattern idl.json --output - | cmp - protocol/idl.json
|
||||
Reference in new issue
Block a user