Skip to content

Commit 934b15c

Browse files
committed
Add prepare release automation
1 parent 75a581f commit 934b15c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/prepare-release.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This is a basic workflow that is manually triggered
2+
3+
name: Create release branch from develop
4+
on:
5+
workflow_dispatch:
6+
branches: [ "develop" ]
7+
8+
jobs:
9+
draft-new-release:
10+
if:
11+
contains(github.ref, 'develop')
12+
name: "Draft a new release"
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python 3.9
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.9"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install poetry
26+
poetry install
27+
- name: Build
28+
id: build-step
29+
run: |
30+
poetry build
31+
VERSION=$(poetry version -s)
32+
echo "$VERSION"
33+
echo "version=$VERSION" >> $GITHUB_OUTPUT
34+
35+
- name: Create release branch
36+
run: git checkout -b release/${{ steps.build-step.outputs.version }}
37+
38+
- name: Push new branch
39+
run: git push origin release/${{ steps.build-step.outputs.version }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Create pull request
44+
run: gh pr create -H release/${{ steps.build-step.outputs.version }} -B main
45+
--title 'Release v${{ steps.build-step.outputs.version }}'
46+
--body 'Created by Github action'
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)