generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (30 loc) · 1022 Bytes
/
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
name: Release
on:
pull_request:
types: [ closed ]
workflow_dispatch:
inputs:
version:
description: Version
required: true
jobs:
release:
if: (github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 5
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_BRANCH: ${{ github.event.pull_request.head.ref || inputs.version }}
steps:
- id: generate_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create release draft
run: |
version=${RELEASE_BRANCH#release/}
gh release create ${version} --title ${version} --generate-notes --discussion-category Announcements
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}