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