Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable import & extend, nightly schedule #5

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
26 changes: 20 additions & 6 deletions .github/workflows/create-apt-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: "Create apt repo"
"on": # TODO: This needs to also become a cron for the nightly function to make sense
push:
pull_request:
schedule:
- cron: '45 6 * * *' # UTC 6:45

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -36,9 +38,13 @@ jobs:
debian-name: amd64
- name: aarch64-unknown-linux-gnu
debian-name: arm64
exclude: # Nightlies are only for latest versions
exclude:
# Nightlies are only for latest versions
- category: {name: nightly}
os: ubuntu-22.04
# Don't rebuild stable every nightly schedule
# TODO: revert the event_name to 'schedule' once done with testing
- category: {name: "${{ github.event_name == 'pull_request' && 'stable' }}"}
steps:
# Step 0. Pick up the stable or nightly source
- name: Checkout Kanidm
Expand Down Expand Up @@ -117,24 +123,32 @@ jobs:
- name: List packages
run: |
find $(pwd) -name '*.deb'
# This step isn't strictly necessary for push & schedule runs,
# but is required for imports to work when the main repo
# key material isn't available, say in a PR.
- name: Get import GPG key
id: get_import_key
run: |
echo 'gpg_public_key<<EOF' >> $GITHUB_OUTPUT
curl -s https://kanidm.github.io/kanidm_ppa/kanidm_ppa.asc >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Create Aptly repo
uses: jinnatar/[email protected]
with:
name: kanidm_ppa
repo_url: https://kanidm.github.io/kanidm_ppa
artifact_name: kanidm_ppa_snapshot
# TODO: Flip stable repo defs false -> true, _after_ we've done the first publish.
# This enables the "import & extend" model.
repos: |
noble,stable,\"amd64,arm64\",false,debs/stable-*-ubuntu-24.04-*-unknown-linux-gnu/*.deb
jammy,stable,\"amd64,arm64\",false,debs/stable-*-ubuntu-22.04-*-unknown-linux-gnu/*.deb
noble,stable,\"amd64,arm64\",true,debs/stable-*-ubuntu-24.04-*-unknown-linux-gnu/*.deb
jammy,stable,\"amd64,arm64\",true,debs/stable-*-ubuntu-22.04-*-unknown-linux-gnu/*.deb
noble,nightly,\"amd64,arm64\",false,debs/nightly-master-ubuntu-24.04-*-unknown-linux-gnu/*.deb
bookworm,stable,\"amd64,arm64\",false,debs/stable-*-debian-12-*-unknown-linux-gnu/*.deb
bookworm,stable,\"amd64,arm64\",true,debs/stable-*-debian-12-*-unknown-linux-gnu/*.deb
bookworm,nightly,\"amd64,arm64\",false,debs/nightly-master-debian-12-*-unknown-linux-gnu/*.deb
# When GPG secrets are not available (say a PR), the repo WILL NOT be signed.
# Provide your own key material in a fork to test with signed repo snapshots.
gpg_private_key: "${{ secrets.GPG_PRIVATE_KEY }}"
gpg_passphrase: "${{ secrets.PASSPHRASE }}"
import_gpg_key: "${{ steps.get_import_key.outputs.gpg_public_key }}"

# Step 4. Publish the created repo if and only if it's a push to main.
publish:
Expand Down
Loading