From 0f35839fb4f2618ba3b832f2f1a736cce090c760 Mon Sep 17 00:00:00 2001 From: WorldTeacher Date: Thu, 29 May 2025 10:05:38 +0200 Subject: [PATCH] update wf, test new changelog generation --- .gitea/workflows/bumptest.yml | 56 ++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/bumptest.yml b/.gitea/workflows/bumptest.yml index a64a549..ed4abdc 100644 --- a/.gitea/workflows/bumptest.yml +++ b/.gitea/workflows/bumptest.yml @@ -19,20 +19,56 @@ jobs: steps: - name: Checkout the code uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Set up Python + run: uv python install + with: + python-version-file: "pyproject.toml" + + - name: Install the project + run: uv sync --locked --all-extras --dev - name: Set Git identity run: | git config user.name "Gitea CI" git config user.email "ci@git.theprivateserver.de" - name: Bump version id: bump - uses: callowayproject/bump-my-version@master - env: - BUMPVERSION_TAG: "true" - with: - args: ${{ inputs.bump-type }} - github-token: ${{ secrets.TOKEN }} - - - name: Check - if: steps.bump.outputs.bumped == 'true' run: | - echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!" \ No newline at end of file + uv tool install bump-my-version + echo "OLD_VERSION<> $GITHUB_ENV + echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + uv tool run bump-my-version bump ${{ github.event.inputs.bump }} + # echo the version to github env, the version is shown by using uv tool run bump-my-version show current_version + echo "VERSION<> $GITHUB_ENV + echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: Check version + run: echo old ${{ env.OLD_VERSION }} new ${{ env.VERSION }} + - name: Update CHANGELOG + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ secrets.TOKEN }} + fromTag: ${{ env.OLD_VERSION }} + toTag: ${{ env.VERSION }} + writeToFile: true + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + - name: Create release + id: create_release + if: ${{ github.event.inputs.github_release == 'true' }} + uses: softprops/action-gh-release@master + with: + tag_name: ${{ env.VERSION }} + release_name: Release ${{ env.VERSION }} + body: ${{ steps.changelog.outputs.changelog }} + draft: false + prerelease: false + make_latest: true + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file