From 972495a12aa7e925f62ab7fb5ee9d3d8d7b13efc Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Wed, 8 Jan 2025 15:40:21 +0100 Subject: [PATCH 1/4] create prepare_release.yml --- .github/workflows/prepare_release.yml | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/prepare_release.yml diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml new file mode 100644 index 000000000..a755683b3 --- /dev/null +++ b/.github/workflows/prepare_release.yml @@ -0,0 +1,57 @@ +name: Release Prep + +on: + workflow_dispatch: + inputs: + branch: + description: 'Branch to merge release notes and code analysis into.' + required: true + default: 'main' + version: + description: + 'Version to use for the release. Must be in format: X.Y.Z.' + date: + description: + 'Date of the release. Must be in format YYYY-MM-DD.' + +jobs: + preparerelease: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install requests==2.31.0 + python -m pip install bandit==1.7.7 + python -m pip install .[test] + + - name: Generate release notes + env: + GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} + run: > + python scripts/release_notes_generator.py + -v ${{ inputs.version }} + -d ${{ inputs.date }} + + - name: Save static code analysis + run: bandit -r . -x ./tests,./scripts,./build -f txt -o static_code_analysis.txt --exit-zero + + - name: Create pull request + id: cpr + uses: peter-evans/create-pull-request@v4 + with: + token: ${{ secrets.GH_ACCESS_TOKEN }} + commit-message: Prepare release for v${{ inputs.version }} + author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + title: v${{ inputs.version }} Release Preparation + body: "This is an auto-generated PR to prepare the release." + branch: prepared-release + branch-suffix: short-commit-hash + base: ${{ inputs.branch }} From 4b57c75549e89a138fe660b23dfae08fc44f9c7d Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Wed, 8 Jan 2025 15:41:39 +0100 Subject: [PATCH 2/4] delete release_note.yml and static_code_analysis.yml --- .github/workflows/release_notes.yml | 52 ---------------------- .github/workflows/static_code_analysis.yml | 35 --------------- 2 files changed, 87 deletions(-) delete mode 100644 .github/workflows/release_notes.yml delete mode 100644 .github/workflows/static_code_analysis.yml diff --git a/.github/workflows/release_notes.yml b/.github/workflows/release_notes.yml deleted file mode 100644 index 2c0acd9d0..000000000 --- a/.github/workflows/release_notes.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Release Notes Generator - -on: - workflow_dispatch: - inputs: - branch: - description: 'Branch to merge release notes into.' - required: true - default: 'main' - version: - description: - 'Version to use for the release. Must be in format: X.Y.Z.' - date: - description: - 'Date of the release. Must be in format YYYY-MM-DD.' - -jobs: - releasenotesgeneration: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install requests==2.31.0 - - - name: Generate release notes - env: - GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - run: > - python scripts/release_notes_generator.py - -v ${{ inputs.version }} - -d ${{ inputs.date }} - - - name: Create pull request - id: cpr - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.GH_ACCESS_TOKEN }} - commit-message: Release notes for v${{ inputs.version }} - author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" - committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" - title: v${{ inputs.version }} Release Notes - body: "This is an auto-generated PR to update the release notes." - branch: release-notes - branch-suffix: short-commit-hash - base: ${{ inputs.branch }} diff --git a/.github/workflows/static_code_analysis.yml b/.github/workflows/static_code_analysis.yml deleted file mode 100644 index 6bb8de34d..000000000 --- a/.github/workflows/static_code_analysis.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Static Code Analysis - -on: - release: - types: [published] - workflow_dispatch: - -jobs: - code-analysis: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install bandit==1.7.7 - - name: Save code analysis - run: bandit -r . -x ./tests -f txt -o static_code_analysis.txt --exit-zero - - name: Create pull request - id: cpr - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.GH_ACCESS_TOKEN }} - commit-message: Update static code analysis - author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" - committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" - title: Latest Code Analysis - body: "This is an auto-generated PR with the **latest** code analysis results." - branch: static-code-analysis - branch-suffix: short-commit-hash - base: main From 6eaa16f3fe0b3f071b813fd8477145f5e3b29673 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Thu, 9 Jan 2025 12:19:20 +0100 Subject: [PATCH 3/4] trigger on pushes --- .github/workflows/prepare_release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index a755683b3..dabedeb3b 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -1,6 +1,9 @@ name: Release Prep on: + push: + branches: + - issue-2305-release-workflow workflow_dispatch: inputs: branch: From e210c537ebab242ee56714476b68efaf80f4d6b7 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Thu, 9 Jan 2025 12:19:52 +0100 Subject: [PATCH 4/4] remove trigger on pushes --- .github/workflows/prepare_release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index dabedeb3b..a755683b3 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -1,9 +1,6 @@ name: Release Prep on: - push: - branches: - - issue-2305-release-workflow workflow_dispatch: inputs: branch: