Skip to content

Signing new packages #321

Signing new packages

Signing new packages #321

Workflow file for this run

name: Sign packages
# Trigger on pushes to main that modify workstation/ (or this workflow)
on:
push:
branches:
- main
paths:
- 'workstation/**'
- '.github/workflows/sign.yml'
- '.github/workflows/autosign.py'
- '.github/workflows/listing.py'
- '.github/workflows/index.html.j2'
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
# TODO: switch to debian (rpm-sign isn't happy with it though)
container: fedora:41
steps:
- name: Install dependencies
run: |
dnf install -y rpmdevtools git git-lfs python3 python3-jinja2 rpm-sign createrepo_c
- uses: actions/checkout@v4
with:
lfs: true
token: ${{ secrets.PUSH_TOKEN }}
- name: Configuration
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
echo "$SIGNING_KEY" | gpg --import -
git config --global --add safe.directory '*'
git config user.email "securedrop@freedom.press"
git config user.name "sdcibot"
- name: Sign packages
run: |
./.github/workflows/autosign.py workstation --fingerprint 83127F68BABB04F3FE9A69AA545E94503FAB65AB
git add .
- name: Clean old packages
run: |
find workstation -mindepth 1 -maxdepth 2 -type d | xargs -I '{}' ./.github/workflows/clean-old.py '{}' 4
git add .
- name: Update metadata
run: |
# Only run if we made changes above, otherwise this'll keep running over and over
# since the timestamp changes.
if [[ -n "$(git diff --staged)" ]]; then
./.github/workflows/build.py
fi
./.github/workflows/listing.py
git add .
- name: git commit and push
run: |
# Index will be clean if there are no changes
git diff-index --quiet HEAD || git commit -m "Signing new packages"
git push origin main