Skip to content

Commit

Permalink
Merge pull request #53 from boozook/ci/release
Browse files Browse the repository at this point in the history
CI: add draft release workflow
  • Loading branch information
boozook authored Sep 14, 2023
2 parents 801e1e0 + 8e3af7e commit c06001d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/labeler@v4
with:
dot: false
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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: |
date +"%D"
CUR_DATE=`date +"%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 }}"
TITLE="${{ format('{0} ({1})', github.event.pull_request.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

0 comments on commit c06001d

Please sign in to comment.