|
14 | 14 | runs-on: ubuntu-latest |
15 | 15 | outputs: |
16 | 16 | dist-files: ${{ steps.collect-dist-files.outputs.files }} |
17 | | - timestamp: ${{ steps.build-release.outputs.timestamp }} |
| 17 | + timestamp: ${{ steps.timestamp.outputs.timestamp }} |
18 | 18 |
|
19 | 19 | steps: |
20 | 20 | - name: Set Timestamp |
|
60 | 60 | - name: Upload dist bundle (internal) |
61 | 61 | uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f |
62 | 62 | with: |
63 | | - name: dist-bundle-${{ github.event.repository.name }}-${{ steps.build-release.outputs.timestamp }} |
| 63 | + name: dist-bundle-${{ github.event.repository.name }}-${{ steps.timestamp.outputs.timestamp }} |
64 | 64 | path: | |
65 | 65 | ./dist/bundles/**/*.jar |
66 | 66 | !./dist/bundles/**/*-javadoc*.jar |
@@ -146,3 +146,53 @@ jobs: |
146 | 146 | env: |
147 | 147 | GITHUB_BEARER: ${{ secrets.GH_PAT_public_read_example_pde_rcp_2026 }} |
148 | 148 | run: ./gradlew --no-daemon clean build |
| 149 | + |
| 150 | + publish-latest-main: |
| 151 | + name: Publish latest-main release |
| 152 | + runs-on: ubuntu-latest |
| 153 | + needs: |
| 154 | + - build-release |
| 155 | + if: github.ref == 'refs/heads/main' && github.event_name == 'push' |
| 156 | + permissions: |
| 157 | + contents: write |
| 158 | + |
| 159 | + steps: |
| 160 | + - name: Checkout |
| 161 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| 162 | + |
| 163 | + - name: Download dist bundle |
| 164 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c |
| 165 | + with: |
| 166 | + name: dist-bundle-${{ github.event.repository.name }}-${{ needs.build-release.outputs.timestamp }} |
| 167 | + path: . |
| 168 | + |
| 169 | + - name: Create or update latest-main release |
| 170 | + env: |
| 171 | + GH_TOKEN: ${{ github.token }} |
| 172 | + GH_REPO: ${{ github.repository }} |
| 173 | + shell: bash |
| 174 | + run: | |
| 175 | + mapfile -t JARS < <(find dist/bundles -name "*.jar" \ |
| 176 | + ! -name "*-javadoc*.jar" \ |
| 177 | + ! -name "*-sources*.jar" \ |
| 178 | + -type f | sort) |
| 179 | +
|
| 180 | + if [ ${#JARS[@]} -eq 0 ]; then |
| 181 | + echo "No JAR files found – skipping release update." |
| 182 | + exit 0 |
| 183 | + fi |
| 184 | +
|
| 185 | + echo "Artifacts to publish:" |
| 186 | + printf ' %s\n' "${JARS[@]}" |
| 187 | +
|
| 188 | + gh release delete latest-main --yes --cleanup-tag 2>/dev/null || true |
| 189 | +
|
| 190 | + printf 'Automatically updated on every successful build of the `main` branch.\n\nCommit: [`%s`](https://github.com/%s/commit/%s)\n' \ |
| 191 | + "${GITHUB_SHA:0:12}" "${GITHUB_REPOSITORY}" "${GITHUB_SHA}" > /tmp/release-notes.md |
| 192 | +
|
| 193 | + gh release create latest-main \ |
| 194 | + --title "Latest main branch build" \ |
| 195 | + --notes-file /tmp/release-notes.md \ |
| 196 | + --prerelease \ |
| 197 | + --target "${GITHUB_SHA}" \ |
| 198 | + "${JARS[@]}" |
0 commit comments