From 1c3f0a08307886b36c9187e68f75a0270ab7611d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 09:34:13 +0000 Subject: [PATCH 1/2] Initial plan From 62decbcb451789aadbe4946335c441477973966f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 09:47:21 +0000 Subject: [PATCH 2/2] Add GitHub Pages docs site and latest-main release publishing workflow Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com> --- .github/workflows/ci.yml | 54 +++- .github/workflows/jekyll-gh-pages.yml | 63 +++++ _doc/Gemfile | 3 + _doc/_config.yml | 15 ++ _doc/_layouts/default.html | 359 ++++++++++++++++++++++++++ _doc/downloads.md | 174 +++++++++++++ _doc/index.md | 43 +++ 7 files changed, 709 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/jekyll-gh-pages.yml create mode 100644 _doc/Gemfile create mode 100644 _doc/_config.yml create mode 100644 _doc/_layouts/default.html create mode 100644 _doc/downloads.md create mode 100644 _doc/index.md 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 @@ + + + + + + + + {% if page.title %}{{ page.title }} – {% endif %}{{ site.github.repository_name | default: site.repository | default: 'apps' }} + {% seo %} + + + +
+ + {{ site.github.repository_name | default: site.repository | default: 'apps' }} + + +
+ +
+ {{ content }} +
+ + + + + + diff --git a/_doc/downloads.md b/_doc/downloads.md new file mode 100644 index 0000000..ae95a31 --- /dev/null +++ b/_doc/downloads.md @@ -0,0 +1,174 @@ +--- +title: Downloads +--- +# Latest Build Artifacts + +This page provides a stable link to the latest OSGi bundle artifacts from the last successful build on the `main` branch. +Artifact information is loaded from the [GitHub Releases API](https://docs.github.com/en/rest/releases/releases#get-a-release-by-tag-name). + +
+

⏳ Loading latest build information from GitHub…

+ + + + +
+ + + +last edit: {{ 'now' | date: "%Y%m%d-%H%M%S" }} diff --git a/_doc/index.md b/_doc/index.md new file mode 100644 index 0000000..fbd644b --- /dev/null +++ b/_doc/index.md @@ -0,0 +1,43 @@ +# io.klib.apps + +OSGi application bundles for [klib.io](https://klib.io) + +* providing OSGi application services and utilities +* `io.klib.app.p2.mirror` — Eclipse p2 repository mirroring service +* built with [bnd](https://bnd.bndtools.org) and [Gradle](https://gradle.org) +* running on `Java 21` +* CI/CD pipeline with automated builds and releases +* published to [Maven Central](https://central.sonatype.com) via Sonatype +* documentation via GitHub Pages + * provide download of [latest build artifacts](downloads) + +## Source repository + +[github.com/klibio/apps](https://github.com/klibio/apps) + +## Quick Links + +- [Downloads](downloads) — latest OSGi bundles from the last successful build on `main` + +## Build + +```bash +# build +./gradlew clean build + +# OSGi tests (default timeout: 5 min) +./gradlew testOSGi -PtestTaskTimeoutMinutes=10 + +# release +export SONATYPE_BEARER= +./gradlew clean release +``` + +last edit: {{ 'now' | date: "%Y%m%d-%H%M%S" }}
+{% assign source_revision = site.source_revision | default: site.github.build_revision %} +{% assign repository_nwo = site.github.repository_nwo | default: site.repository | default: 'klibio/apps' %} +{% if source_revision and source_revision != '' %} +source-revision: {{ source_revision | slice: 0, 12 }} +{% else %} +source-revision:n/a +{% endif %}