name: Post-merge # Runs on every push to master. A single workflow with conditional jobs # replaces the previous 4 separate workflows (release.yml, post-merge.yml, # sync-wiki.yml, and the badges job from ci.yml). # # Job dependency graph: # # detect-type ──┬── release (skip if release commit) # ├── badges (ALWAYS runs — even on release commits) # ├── configure-repo (independent — skip if release commit) # ├── sync-wiki (needs release — skip if release commit/fails) # └── vikunja (needs release — skip if release commit/fails) # # sync-wiki and vikunja depend on release succeeding so that the wiki # and task tracker are only updated when the code is actually released. # If release fails, they are skipped to avoid leaving the wiki or # Vikunja in an inconsistent state with the codebase on master. # # The badges job depends on release so it picks up the latest version # number. It uses `if: always()` with no is-release condition so it # runs on every push to master, including release commits. This # ensures badges (tests, coverage, version, etc.) are always current. # # When release.py creates a "release: vX.Y.Z" commit, the release # commit's post-merge run still updates badges (version badge picks # up the new version). Other jobs skip. The tag push triggers publish.yml. on: push: branches: [master] jobs: detect-type: runs-on: docker timeout-minutes: 10 outputs: is-release: ${{ steps.check.outputs.is-release }} steps: - uses: actions/checkout@v4 with: fetch-depth: 1 - name: Install dependencies run: | . .env 2>/dev/null || true python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.4.3" - name: Check if this is a release commit id: check env: PYTHONPATH: src run: python3 -m devx.ci.detect_release_commit validate-commit-msg: needs: [detect-type] if: needs.detect-type.outputs.is-release == 'false' runs-on: docker timeout-minutes: 5 steps: - uses: actions/checkout@v4 with: fetch-depth: 1 - name: Install dependencies run: | . .env 2>/dev/null || true python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.4.3" - name: Validate latest commit message env: PYTHONPATH: src DEVX_TASK_PREFIX: GRM run: | git log -1 --format=%B > commit-msg.txt python3 -m devx.ci.validate_commit_msg commit-msg.txt --branch master rm -f commit-msg.txt release: needs: [detect-type] if: needs.detect-type.outputs.is-release == 'false' runs-on: docker timeout-minutes: 10 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.REPO_TOKEN }} - name: Set up environment env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} run: make setup-release - name: Configure git run: | git config user.name "grm-ci-bot" git config user.email "grm-ci-bot@oblachno.fyi" - name: Run release env: PYTHONPATH: src DEVX_VERSION_FILE: src/gitea_runner_manager/__init__.py DEVX_TASK_PREFIX: GRM DEVX_VIKUNJA_PROJECT_ID: 6 run: | . .venv/bin/activate export PATH="$HOME/.local/bin:$PATH" python3 -m devx.ci.release - name: Notify on failure if: failure() env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} PYTHONPATH: src run: | export PATH="$HOME/.local/bin:$PATH" python3 -m devx.tools.install_tools --tool tea tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true tea login default grm || true python3 -m devx.ci.notify_failure \ --repo "${{ github.repository }}" \ --run-id "${{ github.run_id }}" \ --workflow "post-merge/release" \ --commit "${{ github.sha }}" sync-wiki: needs: [detect-type, release] if: needs.detect-type.outputs.is-release == 'false' runs-on: docker timeout-minutes: 10 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up environment env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} run: make setup-ci - name: Sync documentation to wiki env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} PYTHONPATH: src run: | . .venv/bin/activate python3 -m devx.ci.sync_wiki --repo "${{ github.repository }}" --strict - name: Notify on failure if: failure() env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} PYTHONPATH: src run: | export PATH="$HOME/.local/bin:$PATH" python3 -m devx.tools.install_tools --tool tea tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true tea login default grm || true python3 -m devx.ci.notify_failure \ --repo "${{ github.repository }}" \ --run-id "${{ github.run_id }}" \ --workflow "post-merge/sync-wiki" \ --commit "${{ github.sha }}" badges: needs: [detect-type, release] if: always() runs-on: docker timeout-minutes: 10 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 ref: master token: ${{ secrets.REPO_TOKEN }} - name: Fetch latest master run: | git fetch origin master git reset --hard origin/master - name: Set up environment env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} run: make setup-ci - name: Generate and push badges env: PRE_COMMIT_ALLOW_NO_CONFIG: "1" run: | . .venv/bin/activate python3 -m devx.ci.push_badges - name: Notify on failure if: failure() env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} PYTHONPATH: src run: | export PATH="$HOME/.local/bin:$PATH" python3 -m devx.tools.install_tools --tool tea tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true tea login default grm || true python3 -m devx.ci.notify_failure \ --repo "${{ github.repository }}" \ --run-id "${{ github.run_id }}" \ --workflow "post-merge/badges" \ --commit "${{ github.sha }}" vikunja: needs: [detect-type, release] if: needs.detect-type.outputs.is-release == 'false' runs-on: docker timeout-minutes: 10 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install dependencies run: | . .env 2>/dev/null || true python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.4.3" - name: Update Vikunja task env: VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }} PYTHONPATH: src DEVX_TASK_PREFIX: GRM DEVX_VIKUNJA_PROJECT_ID: 6 run: python3 -m devx.ci.post_merge --git-sha "${{ github.sha }}" - name: Notify on failure if: failure() env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} PYTHONPATH: src run: | export PATH="$HOME/.local/bin:$PATH" python3 -m devx.tools.install_tools --tool tea tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true tea login default grm || true python3 -m devx.ci.notify_failure \ --repo "${{ github.repository }}" \ --run-id "${{ github.run_id }}" \ --workflow "post-merge/vikunja" \ --commit "${{ github.sha }}" configure-repo: needs: [detect-type] if: needs.detect-type.outputs.is-release == 'false' runs-on: docker timeout-minutes: 10 steps: - uses: actions/checkout@v4 - name: Install dependencies run: | . .env 2>/dev/null || true python3 -m pip install --break-system-packages "git+https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.4.3" - name: Ensure branch protection and labels env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} PYTHONPATH: src DEVX_REPO_NAME: grm DEVX_STATUS_CHECKS: "CI / quality (pull_request),CI / molecule-tests (1) (pull_request),CI / molecule-tests (2) (pull_request),CI / molecule-tests (3) (pull_request)" run: python3 -m devx.tools.configure_repo - name: Notify on failure if: failure() env: REPO_TOKEN: ${{ secrets.REPO_TOKEN }} PYTHONPATH: src run: | export PATH="$HOME/.local/bin:$PATH" python3 -m devx.tools.install_tools --tool tea tea login add --name grm --url "${{ github.server_url }}" --token "$REPO_TOKEN" || true tea login default grm || true python3 -m devx.ci.notify_failure \ --repo "${{ github.repository }}" \ --run-id "${{ github.run_id }}" \ --workflow "post-merge/configure-repo" \ --commit "${{ github.sha }}"