Release #42
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: Release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| name: Create release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.version.outputs.nextStrict }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| - name: Get next version | |
| id: version | |
| uses: ietf-tools/semver-action@c90370b2958652d71c06a3484129a4d423a6d8a8 | |
| with: | |
| token: ${{ github.token }} | |
| branch: ${{ github.event.repository.default_branch }} | |
| noNewCommitBehavior: "warn" | |
| noVersionBumpBehavior: "warn" | |
| patchList: fix, bugfix, perf, refactor, test, tests, chore, build | |
| - name: Create and push tag | |
| if: ${{ steps.version.outputs.nextStrict }} | |
| run: | | |
| set -euo pipefail | |
| git config user.name "fossifybot[bot]" | |
| git config user.email "212866877+fossifybot[bot]@users.noreply.github.com" | |
| new_version="${{ steps.version.outputs.nextStrict }}" | |
| echo "Creating tag: $new_version" | |
| git tag -a "$new_version" -m "$new_version" | |
| git push origin "$new_version" | |
| echo "Created and pushed tag: $new_version" | |
| trigger_jitpack: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.release.outputs.tag }} | |
| steps: | |
| - name: Trigger JitPack build | |
| run: | | |
| TAG='${{ needs.release.outputs.tag }}' | |
| echo "Requesting JitPack build for ${TAG}" | |
| curl -fsSL --max-time 10 "https://jitpack.io/org/fossify/commons/${TAG}/commons-${TAG}.pom" || true | |
| - name: Wait for JitPack to finish | |
| run: | | |
| TAG='${{ needs.release.outputs.tag }}' | |
| URL="https://jitpack.io/org/fossify/commons/${TAG}/commons-${TAG}.pom" | |
| echo "Waiting for JitPack to build ${TAG}..." | |
| sleep 240 | |
| for i in $(seq 1 13); do | |
| echo "Attempt $i: checking ${URL}?check=${i}" | |
| if curl -fsSIL --max-time 10 "${URL}?check=${i}" > /dev/null 2>&1; then | |
| echo "JitPack build successful!" | |
| exit 0 | |
| fi | |
| sleep 60 | |
| done | |
| echo "Timed out waiting for JitPack build." | |
| exit 1 | |
| dispatch_update: | |
| needs: trigger_jitpack | |
| uses: FossifyOrg/.github/.github/workflows/fossify-event-dispatcher.yml@main | |
| with: | |
| task: update-commons | |
| repository: all | |
| secrets: inherit |