Publisher #2904
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publisher | |
on: | |
schedule: | |
- cron: '17 6,18 * * *' | |
workflow_dispatch: | |
concurrency: publisher | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
container: | |
image: archlinux | |
env: | |
CACTUS_CONFIG: ${{ secrets.CACTUS_CONFIG }} | |
steps: | |
- uses: arch4edu/cactus/actions/upgrade-archlinux@main | |
- name: Install runtime dependencies | |
run: pacman -S --noconfirm --needed github-cli namcap openssh patch python-mysqlclient python-pyzstd rsync | |
- uses: arch4edu/cactus/actions/setup-cactus@main | |
- name: Export config | |
id: config | |
run: python -m cactus.common.config | |
- name: Export publisher config and keys | |
run: | | |
echo -n "${{ secrets.CACTUS_PUBLISHER_GPG_KEY }}" | base64 -d > gpg.key | |
echo "${{ secrets.CACTUS_PUBLISHER_SSH_KEY }}" | install -Dm400 /dev/stdin /root/.ssh/ssh_key | |
gpg --import gpg.key | |
python -m cactus.publisher.config | |
- name: Configure GitHub CLI | |
run: echo ${{ steps.config.outputs.github_token }} | gh auth login --with-token | |
- name: Patch repo-add | |
run: | | |
patch /usr/bin/repo-add < cactus/publisher/repo-add.patch | |
echo "$(realpath cactus/publisher/bin)" >> $GITHUB_PATH | |
- name: Publish built packages | |
run: python -m cactus.publisher.publish | |
- name: Remove old and unmaintained packages | |
run: python -m cactus.publisher.clean |