2021-05-26 13:12:36 +00:00
|
|
|
name: Build Guix Installer
|
|
|
|
|
|
|
|
on:
|
2021-05-26 13:15:20 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-26 13:12:36 +00:00
|
|
|
|
2021-05-30 20:09:57 +00:00
|
|
|
schedule:
|
|
|
|
# build every week
|
|
|
|
- cron: "0 0 */7 * *"
|
2021-05-26 13:12:36 +00:00
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Git checkout
|
2024-02-17 16:32:32 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-08-10 19:03:11 +00:00
|
|
|
- name: Guix cache
|
2024-08-10 19:10:13 +00:00
|
|
|
uses: actions/cache/restore@v3
|
2024-08-10 19:03:11 +00:00
|
|
|
with:
|
|
|
|
path: ~/.cache/guix
|
|
|
|
# use a key that (almost) never matches
|
|
|
|
key: guix-cache-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
guix-cache-
|
2021-05-26 13:12:36 +00:00
|
|
|
|
|
|
|
- name: Install Guix
|
2024-02-04 09:00:04 +00:00
|
|
|
uses: PromyLOPh/guix-install-action@v1.5
|
2024-05-13 09:12:25 +00:00
|
|
|
with:
|
|
|
|
channels: |
|
|
|
|
(cons* (channel
|
|
|
|
(name 'nonguix)
|
|
|
|
(url "https://gitlab.com/nonguix/nonguix")
|
|
|
|
(introduction
|
|
|
|
(make-channel-introduction
|
|
|
|
"897c1a470da759236cc11798f4e0a5f7d4d59fbc"
|
|
|
|
(openpgp-fingerprint
|
|
|
|
"2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))
|
|
|
|
%default-channels)
|
2021-05-26 13:12:36 +00:00
|
|
|
|
2024-05-13 08:47:07 +00:00
|
|
|
- name: Set up Nonguix Substitutes
|
|
|
|
run: |
|
|
|
|
# This is necessary to authorize the substitute server
|
|
|
|
wget https://substitutes.nonguix.org/signing-key.pub
|
|
|
|
mv signing-key.pub nonguix-signing-key.pub
|
2024-08-10 19:03:11 +00:00
|
|
|
sudo /var/guix/profiles/per-user/root/current-guix/bin/guix archive --authorize < nonguix-signing-key.pub
|
2024-05-13 08:47:07 +00:00
|
|
|
|
2024-08-10 19:03:11 +00:00
|
|
|
- name: Set daemon level Substitutes
|
|
|
|
run: |
|
|
|
|
SUBSTITUTE_URLS="https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://substitutes.nonguix.org"
|
|
|
|
|
|
|
|
sudo sed -i "s|--substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org'|--substitute-urls='$SUBSTITUTE_URLS'|g" /etc/systemd/system/guix-daemon.service
|
|
|
|
|
|
|
|
sudo systemctl daemon-reload
|
|
|
|
sudo systemctl restart guix-daemon.service
|
|
|
|
|
2021-05-30 21:38:47 +00:00
|
|
|
- name: Build ISO
|
2021-05-30 20:09:57 +00:00
|
|
|
run: |
|
2024-08-10 19:03:11 +00:00
|
|
|
|
2021-06-05 20:21:30 +00:00
|
|
|
# Write out the channels file so it can be included
|
2024-08-10 19:03:11 +00:00
|
|
|
guix time-machine -C ./guix/base-channels.scm -- describe -f channels > ./guix/channels.scm
|
|
|
|
|
2021-06-05 20:21:30 +00:00
|
|
|
# Build the image
|
2024-08-10 19:03:11 +00:00
|
|
|
image=$(guix time-machine -C ./guix/channels.scm -- system image -t iso9660 ./guix/installer.scm)
|
2021-06-05 20:21:30 +00:00
|
|
|
|
|
|
|
# Copy the image to the local folder with a better name
|
2021-05-30 21:10:28 +00:00
|
|
|
export RELEASE_TAG=$(date +"%Y%m%d%H%M")
|
|
|
|
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
|
2021-05-30 21:38:47 +00:00
|
|
|
cp $image ./guix-installer-$RELEASE_TAG.iso
|
2024-08-10 19:03:11 +00:00
|
|
|
- uses: actions/cache/save@v3
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
path: ~/.cache/guix
|
|
|
|
key: guix-cache-${{ github.sha }}
|
2021-05-30 21:38:47 +00:00
|
|
|
|
|
|
|
- name: Prepare Release Notes
|
|
|
|
run: |
|
2021-05-30 21:35:32 +00:00
|
|
|
echo $'This installer image was prepared with the following channel configuration:\r\n\r\n```\r\n' > release-notes.md
|
2021-06-24 03:51:50 +00:00
|
|
|
cat ./guix/channels.scm >> release-notes.md
|
2021-05-30 21:35:32 +00:00
|
|
|
echo $'\r\n```' >> release-notes.md
|
2021-05-30 20:09:57 +00:00
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
2021-05-26 15:23:55 +00:00
|
|
|
with:
|
2021-05-30 21:35:32 +00:00
|
|
|
name: Guix Installer - ${{ env.RELEASE_TAG }}
|
|
|
|
tag_name: v${{ env.RELEASE_TAG }}
|
2021-05-30 20:09:57 +00:00
|
|
|
body_path: release-notes.md
|
2021-05-30 21:38:47 +00:00
|
|
|
files: guix-installer-${{ env.RELEASE_TAG }}.iso
|
2021-05-30 20:09:57 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
GITHUB_REPOSITORY: SystemCrafters/guix-installer
|