-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (36 loc) · 1.01 KB
/
Copy pathrelease.yml
File metadata and controls
40 lines (36 loc) · 1.01 KB
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
name: Publish GitHub Release
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: Marketplace tag to publish
required: true
type: string
permissions:
contents: write
concurrency:
group: github-release-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Create GitHub Release from a marketplace tag
env:
GH_TOKEN: ${{ github.token }}
# No checkout here, so gh cannot infer the repo from a git remote.
GH_REPO: ${{ github.repository }}
TAG: ${{ inputs.tag || github.ref_name }}
run: |
case "$TAG" in
v*) ;;
*) echo "tag must start with v: $TAG" >&2; exit 1 ;;
esac
if gh release view "$TAG" >/dev/null 2>&1; then
exit 0
fi
if ! gh release create "$TAG" --verify-tag --title "$TAG" --generate-notes; then
gh release view "$TAG" >/dev/null
fi