-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.38 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Release
on:
workflow_call:
inputs:
release-tag:
description: 'Release tag'
type: string
required: true
release-title:
description: 'Release title'
type: string
required: true
release-asset:
description: 'Release asset'
type: string
required: true
artifact-name:
description: 'Artifact name'
type: string
required: true
artifact-path:
description: 'Artifact path'
type: string
default: ${{ github.workspace }}
concurrency: ${{ github.job }}-${{ github.ref }}
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4.1.8
with:
name: ${{ inputs.artifact-name }}
path: ${{ inputs.artifact-path }}
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ inputs.release-tag }}
RELEASE_TITLE: ${{ inputs.release-title }}
RELEASE_ASSET: ${{ inputs.release-asset }}
run: |
gh release delete $RELEASE_TAG -y || true
gh release create $RELEASE_TAG -t "$RELEASE_TITLE" -n "$(git log -1 --pretty=format:"%B")" || true
gh release upload $RELEASE_TAG $RELEASE_ASSET --clobber