Skip to content

Commit

Permalink
Publish for systemd-sysupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
mback2k committed Feb 5, 2024
1 parent e2698c4 commit 2f928dd
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 20 deletions.
71 changes: 51 additions & 20 deletions .github/workflows/sysext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- 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 @@ -24,25 +24,56 @@ 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-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:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_name: 'pypy3-${{ github.ref_name }}.raw'
asset_path: 'sysext.raw'
asset_content_type: application/octet-stream
name: Release ${{ github.ref_name }}
files: |
SHA256SUMS
*.raw
*.conf
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Setup

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

```
curl -L https://github.com/mback2k/sysext-pypy3/releases/latest/download/sysupdate-noop.conf --create-dirs -o /etc/sysupdate.d/noop.conf
curl -L https://github.com/mback2k/sysext-pypy3/releases/latest/download/sysupdate-pypy3.conf --create-dirs -o /etc/sysupdate.pypy3.d/pypy3.conf
curl -L https://github.com/mback2k/sysext-pypy3/releases/latest/download/systemd-pypy3.conf --create-dirs -o /etc/systemd/system/systemd-sysupdate.service.d/pypy3.conf
curl -L https://github.com/mback2k/sysext-pypy3/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 2f928dd

Please sign in to comment.