-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (34 loc) · 1.16 KB
/
Copy pathrelease.yml
File metadata and controls
43 lines (34 loc) · 1.16 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
41
42
43
name: Create GitHub Release
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*' # Match semantic version tags like v1.2.3
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get release notes from CHANGELOG.md (optional)
id: changelog
run: |
TAG_NAME=${GITHUB_REF##*/}
NOTES=$(awk "/^## $TAG_NAME/{flag=1;next}/^## /{flag=0}flag" CHANGELOG.md || echo "Release $TAG_NAME")
# Append Docker image link
NOTES="$NOTES
---
📦 Docker Image: [ghcr.io/june07/sublet](https://github.com/june07/sublet/pkgs/container/sublet)"
echo "release_notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.release_notes }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}