update workflow

This commit is contained in:
2025-12-06 08:53:21 +01:00
parent fe3bcf3980
commit 02617e1033

View File

@@ -2,82 +2,81 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
github_release: github_release:
description: 'Create Gitea Release' description: "Create Gitea Release"
default: true default: true
type: boolean type: boolean
bump: bump:
description: 'Bump type' description: "Bump type"
required: true required: true
default: 'patch' default: "patch"
type: choice type: choice
options: options:
- 'major' - "major"
- 'minor' - "minor"
- 'patch' - "patch"
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@master uses: actions/checkout@v5
with: with:
fetch-depth: 0 fetch-depth: 0
fetch-tags: true fetch-tags: true
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@v5 uses: astral-sh/setup-uv@v5
- name: Set up Python - name: Set up Python
run: uv python install run: uv python install
with: with:
python-version-file: "pyproject.toml" python-version-file: "pyproject.toml"
- name: Set Git identity - name: Set Git identity
run: | run: |
git config user.name "Gitea CI" git config user.name "Gitea CI"
git config user.email "ci@git.theprivateserver.de" git config user.email "ci@git.theprivateserver.de"
- name: Bump version - name: Bump version
id: bump id: bump
run: | run: |
uv tool install bump-my-version uv tool install bump-my-version
uv tool run bump-my-version bump ${{ github.event.inputs.bump }} 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 the version to github env, the version is shown by using uv tool run bump-my-version show current_version
echo "VERSION<<EOF" >> $GITHUB_ENV echo "VERSION<<EOF" >> $GITHUB_ENV
echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV
- name: Push changes - name: Push changes
uses: ad-m/github-push-action@master uses: ad-m/github-push-action@master
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }} branch: ${{ github.ref }}
- name: Build Changelog - name: Build Changelog
id: build_changelog id: build_changelog
uses: https://github.com/mikepenz/release-changelog-builder-action@v5 uses: https://github.com/mikepenz/release-changelog-builder-action@v5
with: with:
platform: "gitea" platform: "gitea"
baseURL: "http://192.168.178.110:3000" baseURL: "http://192.168.178.110:3000"
configuration: ".gitea/changelog-config.json" configuration: ".gitea/changelog-config.json"
env: env:
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
- name: Build package - name: Build package
run: uv build run: uv build
- name: Publish package - name: Publish package
env: env:
USERNAME: ${{ github.repository_owner }} USERNAME: ${{ github.repository_owner }}
run: uv publish --publish-url https://git.theprivateserver.de/api/packages/$USERNAME/pypi/ -t ${{ secrets.TOKEN }} run: uv publish --publish-url https://git.theprivateserver.de/api/packages/$USERNAME/pypi/ -t ${{ secrets.TOKEN }}
- name: Create release
- name: Create release id: create_release
id: create_release if: ${{ github.event.inputs.github_release == 'true' }}
if: ${{ github.event.inputs.github_release == 'true' }} uses: softprops/action-gh-release@master
uses: softprops/action-gh-release@master with:
with: tag_name: v${{ env.VERSION }}
tag_name: ${{ env.VERSION }} release_name: Release ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }} body: ${{steps.build_changelog.outputs.changelog}}
body: ${{steps.build_changelog.outputs.changelog}} draft: false
draft: false prerelease: false
prerelease: false make_latest: true
make_latest: true files: |
files: | dist/*
dist/* env:
env: GITHUB_TOKEN: ${{ secrets.TOKEN }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}