-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (37 loc) · 1.28 KB
/
release.yaml
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
name: Release
on:
pull_request:
types:
- closed
branches:
- main
jobs:
create-release:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'release')
steps:
- name: Generate GitHub token
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Extract version from PR title
id: tag
run: echo "${{ github.event.pull_request.title }}" | awk '{print "name=" $2}' >> "$GITHUB_OUTPUT"
- name: Push a new tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ steps.generate-token.outputs.token }}
custom_tag: ${{ steps.tag.outputs.name }}
tag_prefix: ""
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag.outputs.name }}
name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
token: ${{ steps.generate-token.outputs.token }}