diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b8518f6..0ea2dea 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -140,6 +140,11 @@ on: required: false type: string default: "" + bundle-path: + description: "Path to local prebuilt .flatpak bundle file(s). Supports multiple comma- or newline-separated paths and globs." + required: false + type: string + default: "" dry-run: description: "Dry run mode. Build and verify everything, but skip pushing to the registry and publishing the site." required: false @@ -160,6 +165,7 @@ on: jobs: plan: name: Plan build matrix + if: ${{ inputs.bundle-path == '' }} runs-on: ubuntu-latest container: image: ghcr.io/aetherpak/cli:${{ inputs.cli-version }} @@ -504,3 +510,80 @@ jobs: with: name: ${{ inputs.artifact-name }} path: _site + + publish-standalone: + name: Publish prebuilt bundle(s) + if: ${{ inputs.bundle-path != '' }} + runs-on: ubuntu-latest + concurrency: + group: ${{ inputs.concurrency-group != '' && inputs.concurrency-group || format('aetherpak-publish-{0}', github.repository) }} + cancel-in-progress: false + permissions: + contents: read + packages: write + pages: write + id-token: write + environment: + name: ${{ inputs.deploy && 'github-pages' || '' }} + url: ${{ steps.deploy.outputs.page_url }} + steps: + - name: Checkout Code + uses: actions/checkout@v6 + with: + submodules: ${{ inputs.submodules }} + + - name: Resolve Pages URL + id: u + env: + PAGES_URL: ${{ inputs.pages-url }} + DEFAULT_PAGES_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }} + run: | + url="$PAGES_URL"; [ -n "$url" ] || url="$DEFAULT_PAGES_URL" + echo "pages-url=$url" >> "$GITHUB_OUTPUT" + + - name: Resolve actions ref + id: aref + env: + JWR: ${{ github.job_workflow_ref }} + run: | + set -euo pipefail + ref="${JWR##*@}" + echo "ref=${ref}" >> "$GITHUB_OUTPUT" + + - name: Check out actions repo + uses: actions/checkout@v6 + with: + repository: aetherpak/actions + ref: ${{ steps.aref.outputs.ref }} + path: .github/actions/aetherpak + + - name: Publish bundle(s) + uses: ./.github/actions/aetherpak/publish + with: + repo-path: _repo_standalone + bundle-path: ${{ inputs.bundle-path }} + registry: ${{ inputs.registry }} + oci-repository: ${{ inputs.oci-repository }} + pages-url: ${{ steps.u.outputs.pages-url }} + registry-token: ${{ secrets.registry-token || github.token }} + upload-pages-artifact: ${{ inputs.deploy }} + landing-page: ${{ inputs.landing-page }} + pages-artifact-name: ${{ inputs.artifact-name }} + signing: ${{ inputs.signing }} + gpg-private-key: ${{ secrets.gpg-private-key }} + gpg-private-key-passphrase: ${{ secrets.gpg-private-key-passphrase }} + runtime-repo: ${{ inputs.runtime-repo }} + site-subpath: ${{ inputs.site-subpath }} + cli-version: ${{ inputs.cli-version }} + + - name: Deploy + id: deploy + if: ${{ inputs.deploy }} + uses: actions/deploy-pages@v5 + + - name: Upload site artifact + if: ${{ !inputs.deploy }} + uses: actions/upload-artifact@v7 + with: + name: ${{ inputs.artifact-name }} + path: _site diff --git a/README.md b/README.md index 38a3945..c0c049c 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ then enable **Public**. | `site-subpath` | _(empty)_ | Optional subdirectory under site-dir/pages-url to structure the repository files (e.g. `flatpak`) | | `upload-bundle` | `false` | Export the built application as a single `.flatpak` bundle and upload it as a workflow artifact | | `prebuilt-bundle-artifact` | _(empty)_ | Name or pattern of prebuilt bundle workflow artifacts to download and ingest. Supports `{arch}`, `{app-id}`, and `{branch}` placeholders | +| `bundle-path` | _(empty)_ | Path to local prebuilt `.flatpak` bundle file(s). Supports multiple comma- or newline-separated paths and globs | | `dry-run` | `false` | dry run mode: build and verify everything, but skip pushing to the registry and publishing the site | Secrets `gpg-private-key` and `gpg-private-key-passphrase` enable image signing. @@ -339,6 +340,23 @@ jobs: The workflow will download the artifact, resolve any `{arch}`, `{app-id}`, or `{branch}` placeholders in the name, and find the matching `.flatpak` bundle inside it. If the downloaded artifact contains multiple `.flatpak` files, the workflow will use `flatpak info --show-ref` to automatically identify and select the one matching the current matrix cell's `app-id` and `arch`. +### Ingesting local pre-built bundles in the reusable workflow + +If you have prebuilt `.flatpak` bundle files locally in the checked-out repository (or built in a previous job on a self-hosted runner where the workspace is shared), you can pass them directly using the `bundle-path` input. The reusable workflow will publish them in a single job without compiling or running a matrix: + +```yaml +name: Publish Local Pre-built Bundles +on: { push: { branches: [main] } } +permissions: { contents: read, packages: write, pages: write, id-token: write } +jobs: + publish: + uses: aetherpak/actions/.github/workflows/publish.yml@v3 + with: + bundle-path: | + build/*.flatpak + build/org.flatpak.AppA.flatpak +``` + ## More - [ARCHITECTURE.md](ARCHITECTURE.md): how the pieces fit together, what it relies diff --git a/docs/site/index.html b/docs/site/index.html index 5800f12..4bd75c0 100644 --- a/docs/site/index.html +++ b/docs/site/index.html @@ -278,6 +278,7 @@
concurrency-groupOverride the per-repository publish lock. Only for repos publishing several independent sites.site-subpathOptional subdirectory under site-dir to structure the repository files.prebuilt-bundle-artifactName or pattern of prebuilt bundle workflow artifacts to download and ingest. Supports `{arch}`, `{app-id}`, and `{branch}` placeholders. If the artifact contains multiple bundles, the workflow automatically matches by matrix cell app-id and arch.bundle-pathPath to local prebuilt .flatpak bundle file(s). Supports multiple comma- or newline-separated paths and globs. If set, publishes in a single-instance job without running the matrix.dry-runDry run mode: build and verify everything, but skip pushing to the registry and publishing the site. Default false.reconcile-onlySkip build and push; only reconcile the index against the registry and re-deploy. Use after deleting an image.cli-versionaetherpak CLI release / container image tag. Default v0.14.0.