diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 538cd68..4bc419b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest outputs: dist-files: ${{ steps.collect-dist-files.outputs.files }} - timestamp: ${{ steps.build-release.outputs.timestamp }} + timestamp: ${{ steps.timestamp.outputs.timestamp }} steps: - name: Set Timestamp @@ -60,7 +60,7 @@ jobs: - name: Upload dist bundle (internal) uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f with: - name: dist-bundle-${{ github.event.repository.name }}-${{ steps.build-release.outputs.timestamp }} + name: dist-bundle-${{ github.event.repository.name }}-${{ steps.timestamp.outputs.timestamp }} path: | ./dist/bundles/**/*.jar !./dist/bundles/**/*-javadoc*.jar @@ -146,3 +146,53 @@ jobs: env: GITHUB_BEARER: ${{ secrets.GH_PAT_public_read_example_pde_rcp_2026 }} run: ./gradlew --no-daemon clean build + + publish-latest-main: + name: Publish latest-main release + runs-on: ubuntu-latest + needs: + - build-release + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + + - name: Download dist bundle + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c + with: + name: dist-bundle-${{ github.event.repository.name }}-${{ needs.build-release.outputs.timestamp }} + path: . + + - name: Create or update latest-main release + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + shell: bash + run: | + mapfile -t JARS < <(find dist/bundles -name "*.jar" \ + ! -name "*-javadoc*.jar" \ + ! -name "*-sources*.jar" \ + -type f | sort) + + if [ ${#JARS[@]} -eq 0 ]; then + echo "No JAR files found – skipping release update." + exit 0 + fi + + echo "Artifacts to publish:" + printf ' %s\n' "${JARS[@]}" + + gh release delete latest-main --yes --cleanup-tag 2>/dev/null || true + + printf 'Automatically updated on every successful build of the `main` branch.\n\nCommit: [`%s`](https://github.com/%s/commit/%s)\n' \ + "${GITHUB_SHA:0:12}" "${GITHUB_REPOSITORY}" "${GITHUB_SHA}" > /tmp/release-notes.md + + gh release create latest-main \ + --title "Latest main branch build" \ + --notes-file /tmp/release-notes.md \ + --prerelease \ + --target "${GITHUB_SHA}" \ + "${JARS[@]}" diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 0000000..b7ebe88 --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,63 @@ +name: Deploy doc on GitHub Pages + +on: + # Runs after the CI workflow completes on the main branch + workflow_run: + workflows: ["Continuous Integration"] + branches: ["main"] + types: [completed] + + # Runs on pushes targeting the main branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the +# run in-progress and latest queued. Do NOT cancel in-progress runs. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + doc-build: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + + - name: Inject source revision for docs + run: 'echo "source_revision: ${GITHUB_SHA}" >> _doc/_config.yml' + + - name: Setup Pages + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b + + - name: Build with Jekyll + uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 + with: + source: ./_doc + destination: ./_site + + - name: Upload artifact + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: doc-build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e diff --git a/_doc/Gemfile b/_doc/Gemfile new file mode 100644 index 0000000..ab74e9d --- /dev/null +++ b/_doc/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' +gem 'github-pages', group: :jekyll_plugins +gem "webrick", "~> 1.8" diff --git a/_doc/_config.yml b/_doc/_config.yml new file mode 100644 index 0000000..32714a3 --- /dev/null +++ b/_doc/_config.yml @@ -0,0 +1,15 @@ +plugins: + - jekyll-github-metadata + - jekyll-seo-tag + - jekyll-sitemap +markdown: kramdown + +github: [metadata] +repository: klibio/apps + +defaults: + - + scope: + path: "" + values: + layout: default diff --git a/_doc/_layouts/default.html b/_doc/_layouts/default.html new file mode 100644 index 0000000..ec3bc0e --- /dev/null +++ b/_doc/_layouts/default.html @@ -0,0 +1,359 @@ + + +
+ + + + +⏳ Loading latest build information from GitHub…
+ + + + +