Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on:
jobs:
bump-up-version:
if: github.event.pull_request.merged == true
secrets: inherit
secrets:
SECRET: ${{secrets.VERSION_DECOIMPACT}}
uses: ./.github/workflows/version_upgrade.yml
with:
release_type: patch
9 changes: 7 additions & 2 deletions .github/workflows/mkdocs_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
jobs:
create-docs:
runs-on: ubuntu-latest
env:
if: ${{ lower(inputs.project_version) == upper(inputs.project_version) }}
env:
VERSION: ${{ inputs.project_version }}

steps:
- name: checkout code
uses: actions/checkout@v4
Expand All @@ -30,5 +35,5 @@ jobs:
run: |
git config user.name github-actions
git config user.email github-actions@github.com
poetry run mike deploy --push --update-aliases ${{ inputs.project_version }} latest
poetry run mike set-default --push latest
poetry run mike deploy --push --update-aliases "$VERSION" latest
poetry run mike set-default --push latest
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@

jobs:
bump-up-version:
secrets: inherit
secrets:
SECRET: ${{secrets.VERSION_DECOIMPACT}}
uses: ./.github/workflows/version_upgrade.yml
with:
release_type: ${{ github.event.inputs.release_type }}

create-release:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
runs-on: ubuntu-latest
needs: bump-up-version
steps:
Expand All @@ -37,13 +38,16 @@

create-documentation:
needs: bump-up-version
secrets: inherit
secrets:
SECRET: ${{secrets.VERSION_DECOIMPACT}}
uses: ./.github/workflows/mkdocs_documentation.yml
with:
project_version: ${{ needs.bump-up-version.outputs.project_version }}

docker-build:
needs: bump-up-version
uses: ./.github/workflows/docker_image.yml
secrets:
SECRET: ${{ secrets.GITHUB_TOKEN }}
with:
project_version: ${{ needs.bump-up-version.outputs.project_version }}
8 changes: 6 additions & 2 deletions .github/workflows/version_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
inputs:
release_type:
required: true
description: Choose type of release
type: string
outputs:
project_version:
Expand All @@ -18,6 +19,9 @@ on:
jobs:
upgrade-version:
runs-on: ubuntu-latest
env:
# check if the input is valid, if not set it to empty string, if valid it will be used in the poetry version command
RELEASE_TYPE: ${{ (inputs.release_type == 'major' || inputs.release_type == 'minor' || inputs.release_type == 'patch') && inputs.release_type || '' }}
outputs:
job_output_version: ${{ steps.get-version.outputs.PROJECT_VERSION}}
steps:
Expand All @@ -39,7 +43,7 @@ jobs:
run: |
git config user.name github-actions
git config user.email github-actions@github.com
poetry version ${{ inputs.release_type }}
poetry version "$RELEASE_TYPE"
PROJECT_VERSION=$(poetry version --short)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_OUTPUT
sed -i "1 s/.*/version: $PROJECT_VERSION/" template_input.yaml
Expand All @@ -48,5 +52,5 @@ jobs:
PROJECT_VERSION=$(poetry version --short)
git add template_input.yaml
git add pyproject.toml
git commit -m "bump ${{ inputs.release_type }} version: ${{ steps.get-version.outputs.PROJECT_VERSION }}"
git commit -m "bump "$RELEASE_TYPE" version: ${{ steps.get-version.outputs.PROJECT_VERSION }}"
git push