Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ <h2>Configuration</h2>
<div class="opt"><code>concurrency-group</code><span>Override the per-repository publish lock. Only for repos publishing several independent sites.</span></div>
<div class="opt"><code>site-subpath</code><span>Optional subdirectory under site-dir to structure the repository files.</span></div>
<div class="opt"><code>prebuilt-bundle-artifact</code><span>Name 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 <code>app-id</code> and <code>arch</code>.</span></div>
<div class="opt"><code>bundle-path</code><span>Path to local prebuilt <code>.flatpak</code> bundle file(s). Supports multiple comma- or newline-separated paths and globs. If set, publishes in a single-instance job without running the matrix.</span></div>
<div class="opt"><code>dry-run</code><span>Dry run mode: build and verify everything, but skip pushing to the registry and publishing the site. Default <code>false</code>.</span></div>
<div class="opt"><code>reconcile-only</code><span>Skip build and push; only reconcile the index against the registry and re-deploy. Use after deleting an image.</span></div>
<div class="opt"><code>cli-version</code><span>aetherpak CLI release / container image tag. Default <code>v0.14.0</code>.</span></div>
Expand Down
Loading