Build Guix Installer #241
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: Build Guix Installer | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
# build every week | |
- cron: "0 0 */7 * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Guix cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: ~/.cache/guix | |
# use a key that (almost) never matches | |
key: guix-cache-${{ github.sha }} | |
restore-keys: | | |
guix-cache- | |
- name: Install Guix | |
uses: PromyLOPh/[email protected] | |
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) | |
- 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 | |
sudo /var/guix/profiles/per-user/root/current-guix/bin/guix archive --authorize < nonguix-signing-key.pub | |
- 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 | |
- name: Build ISO | |
run: | | |
# Write out the channels file so it can be included | |
guix time-machine -C ./guix/base-channels.scm -- describe -f channels > ./guix/channels.scm | |
# Build the image | |
image=$(guix time-machine -C ./guix/channels.scm -- system image -t iso9660 ./guix/installer.scm) | |
# Copy the image to the local folder with a better name | |
export RELEASE_TAG=$(date +"%Y%m%d%H%M") | |
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | |
cp $image ./guix-installer-$RELEASE_TAG.iso | |
- uses: actions/cache/save@v3 | |
if: always() | |
with: | |
path: ~/.cache/guix | |
key: guix-cache-${{ github.sha }} | |
- name: Prepare Release Notes | |
run: | | |
echo $'This installer image was prepared with the following channel configuration:\r\n\r\n```\r\n' > release-notes.md | |
cat ./guix/channels.scm >> release-notes.md | |
echo $'\r\n```' >> release-notes.md | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Guix Installer - ${{ env.RELEASE_TAG }} | |
tag_name: v${{ env.RELEASE_TAG }} | |
body_path: release-notes.md | |
files: guix-installer-${{ env.RELEASE_TAG }}.iso | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: SystemCrafters/guix-installer |