JoomEngine – Automated Build & Version Tracking #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: JoomEngine – Automated Build & Version Tracking | |
| on: | |
| repository_dispatch: | |
| types: [ pkg-component-builder-updated ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| build-and-publish: | |
| name: Run ./src/bin/joomengine.sh and track changes | |
| runs-on: ubuntu-latest | |
| steps: | |
| # -------------------------------------------------- | |
| # CHECKOUT | |
| # -------------------------------------------------- | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # -------------------------------------------------- | |
| # TOOLING | |
| # -------------------------------------------------- | |
| - name: Install required tooling | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| jq \ | |
| xmlstarlet \ | |
| gawk \ | |
| curl | |
| # -------------------------------------------------- | |
| # DOCKER AUTH (CI-ONLY) | |
| # -------------------------------------------------- | |
| - name: Authenticate with Docker registry | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # -------------------------------------------------- | |
| # RUN SCRIPT | |
| # -------------------------------------------------- | |
| - name: Run ./src/bin/joomengine.sh | |
| run: | | |
| chmod +x ./src/bin/joomengine.sh | |
| ./src/bin/joomengine.sh | |
| # -------------------------------------------------- | |
| # DETECT CHANGES | |
| # -------------------------------------------------- | |
| - name: Detect repository changes | |
| id: git-status | |
| run: | | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| echo "changed=yes" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=no" >> "$GITHUB_OUTPUT" | |
| fi | |
| # -------------------------------------------------- | |
| # COMMIT BACK (ONLY IF NEEDED) | |
| # -------------------------------------------------- | |
| - name: Commit and push changes | |
| if: steps.git-status.outputs.changed == 'yes' | |
| run: | | |
| DATE="$(date -u +'%Y-%m-%d')" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git commit -m "chore: automated version update (${DATE})" | |
| git push | |
| # -------------------------------------------------- | |
| # NO-OP LOG (FOR VISIBILITY) | |
| # -------------------------------------------------- | |
| - name: No changes detected | |
| if: steps.git-status.outputs.changed == 'no' | |
| run: | | |
| echo "ℹ️ No repository changes detected — nothing to commit." | |