forked from comit-network/xmr-btc-swap
-
Notifications
You must be signed in to change notification settings - Fork 93
47 lines (40 loc) · 1.41 KB
/
Copy pathcreate-release.yml
File metadata and controls
47 lines (40 loc) · 1.41 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
44
45
46
47
name: "Create release"
on:
pull_request:
types:
- closed
jobs:
create_release:
name: Create from merged release branch
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.7
- uses: actionhippie/swap-space@v1
with:
size: 15G
- name: Extract version from branch name
id: extract-version
shell: python
run: |
import os
branch_name = "${{ github.event.pull_request.head.ref }}"
version = branch_name.split("/")[1]
with open(os.environ['GITHUB_OUTPUT'], 'a') as output_file:
output_file.write(f'version={version}\n')
- name: Extract changelog section for release
id: changelog
uses: coditory/changelog-parser@v1
with:
version: ${{ steps.extract-version.outputs.version }}
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
with:
tag_name: ${{ steps.extract-version.outputs.version }}
release_name: ${{ steps.extract-version.outputs.version }}
draft: false
prerelease: false
body: ${{ steps.changelog.outputs.description }}
commitish: ${{ github.event.pull_request.merge_commit_sha }}