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

Commit

Permalink
Publish for systemd-sysupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
mback2k committed Feb 4, 2024
1 parent 9d9c2fa commit 066649b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 20 deletions.
61 changes: 41 additions & 20 deletions .github/workflows/sysext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
steps:
- run: sudo apt install -y ninja-build

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- run: make

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: 'sysext'
path: 'sysext.raw'
Expand All @@ -26,25 +26,46 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: 'sysext'

- id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false

- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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-${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:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_name: 'qemu-ga-${{ github.ref_name }}.raw'
asset_path: 'sysext.raw'
asset_content_type: application/octet-stream
name: Release ${{ github.ref_name }}
files: |
SHA256SUMS
*.raw
*.conf
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Setup

Steps to install and ensure automatic updates using systemd-sysupdate:

```
curl -L https://github.com/mback2k/sysext-qemu-ga/releases/latest/download/sysupdate-qemu-ga.conf --create-dirs -o /etc/sysupdate.qemu-ga.d/qemu-ga.conf
curl -L https://github.com/mback2k/sysext-qemu-ga/releases/latest/download/systemd-qemu-ga.conf --create-dirs -o /etc/systemd/system/systemd-sysupdate.service.d/qemu-ga.conf
curl -L https://github.com/mback2k/sysext-qemu-ga/releases/latest/download/systemd-sysext.conf --create-dirs -o /etc/systemd/system/systemd-sysupdate.service.d/sysext.conf
systemctl daemon-reload
systemctl enable systemd-sysupdate.timer
systemctl start systemd-sysupdate.service
```

0 comments on commit 066649b

Please sign in to comment.