Skip to content

Nightlies

Nightlies #985

Workflow file for this run

name: Nightlies
on:
schedule:
- cron: "0 6 * * *"
push:
branches:
- main
pull_request: # To test changes in this workflow
paths:
- '.github/workflows/nightlies.yml'
# Only allow one job to run at a time because we're pushing to git repos;
# the string value doesn't matter, just that it's a fixed string.
concurrency:
group: "just-one-please-${{ github.ref }}"
defaults:
run:
shell: bash
jobs:
build-rpm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fedora_version:
- 37 # Qubes 4.2
- 41 # Qubes 4.3
container:
image: quay.io/fedora/fedora:${{ matrix.fedora_version }}
steps:
- run: dnf install -y make git
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install dependencies
run: make build-deps
- name: Build RPM
run: |
git config --global --add safe.directory '*'
# Version format is "${VERSION}-0.YYYYMMDDHHMMSS.fXX", which sorts lower than "${VERSION}-1"
rpmdev-bumpspec --new="$(cat VERSION)-0.$(date +%Y%m%d%H%M%S)%{?dist}" rpm-build/SPECS/*.spec
make build-rpm
- uses: actions/upload-artifact@v6
id: upload
with:
name: rpm-build-${{ matrix.fedora_version }}
path: rpm-build/RPMS/noarch/*.rpm
if-no-files-found: error
commit-and-push:
if: ${{ github.ref == 'refs/heads/main' }} # Skip when testing workflow
runs-on: ubuntu-latest
container: debian:bookworm
needs:
- build-rpm
steps:
- name: Install dependencies
run: |
apt-get update && apt-get install --yes git git-lfs
- uses: actions/download-artifact@v7
with:
pattern: "*"
- uses: actions/checkout@v6
with:
repository: "freedomofpress/securedrop-yum-test"
path: "securedrop-yum-test"
lfs: true
persist-credentials: false
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.FPF_BRANCH_UPDATER_APP_ID }}
private-key: ${{ secrets.FPF_BRANCH_UPDATER_APP_PRIVKEY }}
repositories: securedrop-yum-test
- name: Commit and push
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
TARGET_REPO: freedomofpress/securedrop-yum-test
run: |
git config --global user.email "securedrop@freedom.press"
git config --global user.name "sdcibot-nightlies[bot]"
cd securedrop-yum-test
mkdir -p workstation/dom0/f37-nightlies
cp -v ../rpm-build-37/*.rpm workstation/dom0/f37-nightlies/
mkdir -p workstation/dom0/f41-nightlies
cp -v ../rpm-build-41/*.rpm workstation/dom0/f41-nightlies/
git add .
git diff-index --quiet HEAD || git commit -m "Automated SecureDrop workstation build"
# Sleep before we push so the token will have propagated across GitHub infra
sleep 5
git push https://x-access-token:${GH_TOKEN}@github.com/${TARGET_REPO}.git main
get-main-commit:
runs-on: ubuntu-latest
outputs:
main-commit: ${{ steps.get_main_sha.outputs.result }}
steps:
- name: Get SHA of main branch
id: get_main_sha
uses: actions/github-script@v8
with:
result-encoding: string
script: |
const { data: branch } = await github.rest.repos.getBranch({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'main'
});
return branch.commit.sha;
openqa-nightly-dev:
uses: ./.github/workflows/openqa.yml
secrets: inherit
needs: ["get-main-commit"]
strategy:
matrix:
qubes_version: ["4.2", "4.3"]
with:
environment: "dev"
git_ref: ${{ needs.get-main-commit.outputs.main-commit}}
qubes_ver: ${{ matrix.qubes_version }}