Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Publish for systemd-sysupdate #8

Publish for systemd-sysupdate

Publish for systemd-sysupdate #8

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: sudo apt install -y ninja-build
- uses: actions/checkout@v4
- run: make
- uses: actions/upload-artifact@v4
with:
name: 'sysext'
path: 'sysext.raw'
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: 'sysext'
- run: |
repository="${{ github.repository }}"
repository_name="${repository#*/}"
component="${repository_name#*-}"
mv sysext.raw "${component}-${{ github.ref_name }}-x86-64.raw"
sha256sum *.raw > SHA256SUMS
cat << EOF > "sysupdate-noop.conf"
[Source]
Type=regular-file
Path=/
[email protected]
[Target]
Type=regular-file
Path=/
EOF
cat << EOF > "sysupdate-${component}.conf"
[Transfer]
Verify=false
[Source]
Type=url-file
Path=https://github.com/${{ github.repository }}/releases/latest/download/
MatchPattern=${component}-@v-%a.raw
[Target]
InstancesMax=3
Type=regular-file
Path=/opt/extensions/${component}
CurrentSymlink=/etc/extensions/${component}.raw
EOF
cat << EOF > "systemd-${component}.conf"
[Service]
ExecStartPre=/usr/lib/systemd/systemd-sysupdate -C ${component} update
EOF
cat << EOF > "systemd-sysext.conf"
[Service]
ExecStartPost=/usr/bin/systemctl restart systemd-sysext
EOF
- uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
files: |
SHA256SUMS
*.raw
*.conf