diff --git a/.gitea/workflows/docs.yml b/.gitea/workflows/docs.yml index ec0e85b..d7dccee 100644 --- a/.gitea/workflows/docs.yml +++ b/.gitea/workflows/docs.yml @@ -4,25 +4,60 @@ on: branches: - master - main -permissions: - contents: read - pages: write - id-token: write + paths: + - "docs/**" + - "zensical.toml" jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + deploy-wiki: runs-on: ubuntu-latest steps: - - uses: actions/configure-pages@v5 - - uses: actions/checkout@v5 - - uses: actions/setup-python@v5 + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Checkout wiki + uses: actions/checkout@v5 with: - python-version: 3.x - - run: pip install zensical - - run: zensical build --clean - - uses: actions/upload-pages-artifact@v4 - with: - path: site - - uses: actions/deploy-pages@v4 + repository: ${{ gitea.repository }}.wiki + path: wiki + token: ${{ secrets.GITEA_TOKEN }} + + - name: Copy docs to wiki + run: | + # Remove old wiki content (except .git) + find wiki -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} + + + # Copy markdown files maintaining structure + cp -r docs/* wiki/ + + # Rename index.md to Home.md for wiki homepage + if [ -f wiki/index.md ]; then + mv wiki/index.md wiki/Home.md + fi + + # Flatten folder structure for Gitea wiki compatibility + # Move files from subfolders to root with prefixed names + for dir in wiki/*/; do + if [ -d "$dir" ]; then + dirname=$(basename "$dir") + for file in "$dir"*.md; do + if [ -f "$file" ]; then + filename=$(basename "$file") + if [ "$filename" = "index.md" ]; then + mv "$file" "wiki/${dirname}.md" + else + mv "$file" "wiki/${dirname}-${filename}" + fi + fi + done + rm -rf "$dir" + fi + done + + - name: Push to wiki + run: | + cd wiki + git config user.name "Gitea Actions" + git config user.email "actions@gitea.local" + git add -A + git diff --staged --quiet || git commit -m "Update wiki from docs [skip ci]" + git push diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 741c6d0..d9a5503 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -48,12 +48,7 @@ jobs: # Uses the version specified in pyproject.toml python-version-file: "pyproject.toml" - - name: Set Git identity - run: | - git config user.name "Gitea CI" - git config user.email "ci@git.theprivateserver.de" - - - name: Bump version + - name: Bump version (local only) id: bump run: | uv tool install bump-my-version @@ -64,13 +59,6 @@ jobs: echo "VERSION=$version" >> "$GITHUB_ENV" echo "version=$version" >> "$GITHUB_OUTPUT" echo "tag=v$version" >> "$GITHUB_OUTPUT" - # no env needed here, uv handles the Python it installs - - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} - name: Build Changelog id: build_changelog @@ -221,3 +209,40 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.TOKEN }} # GITHUB_REPOSITORY: ${{ github.repository }} + + finalize: + needs: [prepare, build-linux, build-windows] + runs-on: ubuntu-latest + env: + VERSION: ${{ needs.prepare.outputs.version }} + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Install uv + uses: astral-sh/setup-uv@v7 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: "pyproject.toml" + + - name: Set Git identity + run: | + git config user.name "Gitea CI" + git config user.email "ci@git.theprivateserver.de" + + - name: Bump version and push + run: | + uv tool install bump-my-version + uv tool run bump-my-version bump "${{ github.event.inputs.bump }}" + + - name: Push version bump + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }}