Nightly Release #21
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: Nightly Release | |
| on: | |
| # rebuild on every push to the default branch | |
| push: | |
| branches: [ main ] | |
| # …and once a day at 04:00 UTC (if uncommented) | |
| # schedule: | |
| # - cron: '0 4 * * *' | |
| workflow_run: | |
| workflows: ["Auto‑Bump SQLite‑JDBC"] | |
| types: [completed] | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| env: | |
| BOT_NAME: "Axionize (automation)" | |
| BOT_EMAIL: "[email protected]" | |
| steps: | |
| # ───────────────────────────────────────────────────────────── | |
| # 1. Check out sources | |
| # ───────────────────────────────────────────────────────────── | |
| - uses: actions/checkout@v3 | |
| # ───────────────────────────────────────────────────────────── | |
| # 2. JDK8 + Gradle cache | |
| # ───────────────────────────────────────────────────────────── | |
| - name: Set up JDK8 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: temurin | |
| java-version: '8' | |
| cache: gradle | |
| # ───────────────────────────────────────────────────────────── | |
| # 3. Validate wrapper (supply SHA-256 whitelist) | |
| # ───────────────────────────────────────────────────────────── | |
| - name: Validate Gradle wrapper | |
| uses: gradle/wrapper-validation-action@v1 | |
| # ───────────────────────────────────────────────────────────── | |
| # 4. Build shaded JAR | |
| # ───────────────────────────────────────────────────────────── | |
| - name: Build | |
| uses: gradle/gradle-build-action@v2 | |
| with: | |
| arguments: clean build --no-daemon --stacktrace | |
| # ───────────────────────────────────────────────────────────── | |
| # 5. Find the JAR and extract its version | |
| # ───────────────────────────────────────────────────────────── | |
| - name: Locate JAR & extract version | |
| id: locate | |
| run: | | |
| set -e | |
| jar=$(ls -1 build/libs/*-all.jar | head -n1) | |
| echo "jar=$jar" >>"$GITHUB_OUTPUT" | |
| # Handles both YYYYMMDD and YYYY-MM-DD dates | |
| ver=$(basename "$jar" | sed -E 's/^sqlite-jdbc-([0-9.]+\+[0-9]{8}|[0-9.]+\+[0-9]{4}-[0-9]{2}-[0-9]{2})-all\.jar$/\1/') | |
| echo "ver=$ver" >>"$GITHUB_OUTPUT" | |
| # ───────────────────────────────────────────────────────────── | |
| # 6. Create/update a version‑tagged release | |
| # ───────────────────────────────────────────────────────────── | |
| - name: Publish nightly release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: nightly-${{ steps.locate.outputs.ver }} # ex: nightly-3.49.1.0+20250420 | |
| name: Nightly ${{ steps.locate.outputs.ver }} | |
| artifacts: ${{ steps.locate.outputs.jar }} | |
| prerelease: true | |
| makeLatest: true # marks this release as “latest” | |
| token: ${{ secrets.GITHUB_TOKEN }} |