Skip to content

Commit 85fb0ee

Browse files
committed
create prepare_release workflow
1 parent 3f06a28 commit 85fb0ee

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release Prep
2+
3+
on:
4+
push:
5+
branches:
6+
- issue-442-prepare-release
7+
workflow_dispatch:
8+
inputs:
9+
branch:
10+
description: 'Branch to merge release notes and code analysis into.'
11+
required: true
12+
default: 'main'
13+
version:
14+
description:
15+
'Version to use for the release. Must be in format: X.Y.Z.'
16+
date:
17+
description:
18+
'Date of the release. Must be in format YYYY-MM-DD.'
19+
20+
jobs:
21+
preparerelease:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python 3.10
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.10'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install requests==2.31.0
34+
python -m pip install bandit==1.7.7
35+
python -m pip install .[test]
36+
37+
- name: Generate release notes
38+
env:
39+
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
40+
run: >
41+
python scripts/release_notes_generator.py
42+
-v ${{ inputs.version }}
43+
-d ${{ inputs.date }}
44+
45+
- name: Save static code analysis
46+
run: bandit -r . -x ./tests,./scripts,./build -f txt -o static_code_analysis.txt --exit-zero
47+
48+
- name: Create pull request
49+
id: cpr
50+
uses: peter-evans/create-pull-request@v4
51+
with:
52+
token: ${{ secrets.GH_ACCESS_TOKEN }}
53+
commit-message: Prepare release for v${{ inputs.version }}
54+
author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
55+
committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
56+
title: v${{ inputs.version }} Release Preparation
57+
body: "This is an auto-generated PR to prepare the release."
58+
branch: prepared-release
59+
branch-suffix: short-commit-hash
60+
base: ${{ inputs.branch }}

0 commit comments

Comments
 (0)