-
-
Notifications
You must be signed in to change notification settings - Fork 8
36 lines (33 loc) · 1.03 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
name: Release
on:
milestone:
types: [closed]
workflow_call:
workflow_dispatch:
jobs:
draft:
name: Draft
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write
steps:
- name: Date
id: date
run: |
CUR_DATE=`date +"%Y.%m.%d"`
echo "value=$CUR_DATE" >> "$GITHUB_OUTPUT"
- name: Title
id: title
run: |
# https://docs.github.com/en/rest/issues/milestones?apiVersion=2022-11-28#get-a-milestone
TITLE="${{ github.event_name == 'milestone' && format('{0} ({1})', github.event.milestone.title, steps.date.outputs.value) || steps.date.outputs.value }}"
echo "value=$TITLE" >> "$GITHUB_OUTPUT"
- name: Page
id: release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ (startsWith(github.ref, 'refs/tags/') && github.ref) || steps.date.outputs.value }}
name: ${{ steps.title.outputs.value }}
generate_release_notes: true