lan login for schemes pipeline as well
This commit is contained in:
parent
15f998179d
commit
cad0288d68
152
.github/workflows/build-schemes.yml
vendored
152
.github/workflows/build-schemes.yml
vendored
@ -3,8 +3,8 @@ name: Build All Color Schemes
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'config/schemes.nix'
|
- "config/schemes.nix"
|
||||||
- 'config/scheme-utils.nix'
|
- "config/scheme-utils.nix"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -12,81 +12,81 @@ jobs:
|
|||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
env:
|
env:
|
||||||
HOSTNAME: server
|
HOSTNAME: server
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get available schemes
|
- name: Get available schemes
|
||||||
id: schemes
|
id: schemes
|
||||||
run: |
|
run: |
|
||||||
SCHEMES=$(nix eval --raw --impure --expr '
|
SCHEMES=$(nix eval --raw --impure --expr '
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> {};
|
pkgs = import <nixpkgs> {};
|
||||||
inputs = {};
|
inputs = {};
|
||||||
utils = import ./scripts/scheme-utils.nix { inherit pkgs inputs; };
|
utils = import ./scripts/scheme-utils.nix { inherit pkgs inputs; };
|
||||||
in
|
in
|
||||||
builtins.concatStringsSep " " utils.availableSchemes
|
builtins.concatStringsSep " " utils.availableSchemes
|
||||||
')
|
')
|
||||||
echo "schemes=$SCHEMES" >> $GITHUB_OUTPUT
|
echo "schemes=$SCHEMES" >> $GITHUB_OUTPUT
|
||||||
echo "Available schemes: $SCHEMES"
|
echo "Available schemes: $SCHEMES"
|
||||||
|
|
||||||
- name: Configure Attic cache
|
- name: Configure Attic cache
|
||||||
run: |
|
run: |
|
||||||
# Configure attic client to use your cache server
|
# Configure attic client to use your cache server
|
||||||
attic login servidos https://cache.servidos.lat ${{ secrets.ATTIC_TOKEN }}
|
attic login servidos http://127.0.0.1:2343 ${{ secrets.ATTIC_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push all schemes
|
- name: Build and push all schemes
|
||||||
run: |
|
run: |
|
||||||
echo "Building and pushing all schemes..."
|
echo "Building and pushing all schemes..."
|
||||||
|
|
||||||
# Store original scheme
|
# Store original scheme
|
||||||
ORIGINAL_SCHEME=$(grep -oP "scheme = schemesFile\.schemes\.\K\w+" config/stylix.nix)
|
ORIGINAL_SCHEME=$(grep -oP "scheme = schemesFile\.schemes\.\K\w+" config/stylix.nix)
|
||||||
echo "Original scheme: $ORIGINAL_SCHEME"
|
echo "Original scheme: $ORIGINAL_SCHEME"
|
||||||
|
|
||||||
# Build and push each scheme
|
# Build and push each scheme
|
||||||
for scheme in ${{ steps.schemes.outputs.schemes }}; do
|
for scheme in ${{ steps.schemes.outputs.schemes }}; do
|
||||||
|
echo "========================================="
|
||||||
|
echo "Processing scheme: $scheme"
|
||||||
|
echo "========================================="
|
||||||
|
|
||||||
|
# Update stylix.nix to use this scheme
|
||||||
|
sed -i "s/scheme = schemesFile\.schemes\.\w\+;/scheme = schemesFile.schemes.$scheme;/" config/stylix.nix
|
||||||
|
|
||||||
|
# Verify the change
|
||||||
|
grep "scheme = schemesFile.schemes" config/stylix.nix
|
||||||
|
|
||||||
|
# Build the configuration
|
||||||
|
echo "Building $scheme..."
|
||||||
|
nix build .#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel \
|
||||||
|
--out-link ./result-$scheme \
|
||||||
|
--quiet
|
||||||
|
|
||||||
|
# Push to cache
|
||||||
|
echo "Pushing $scheme to cache..."
|
||||||
|
attic push servidos:nixos ./result-$scheme
|
||||||
|
|
||||||
|
# Also push using print-out-paths for better cache coverage
|
||||||
|
nix build .#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel \
|
||||||
|
--print-out-paths \
|
||||||
|
--quiet | attic push servidos:nixos --stdin
|
||||||
|
|
||||||
|
echo "✓ Completed $scheme"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
# Restore original scheme
|
||||||
|
echo "Restoring original scheme: $ORIGINAL_SCHEME"
|
||||||
|
sed -i "s/scheme = schemesFile\.schemes\.\w\+;/scheme = schemesFile.schemes.$ORIGINAL_SCHEME;/" config/stylix.nix
|
||||||
|
|
||||||
echo "========================================="
|
echo "========================================="
|
||||||
echo "Processing scheme: $scheme"
|
echo "All schemes built and pushed successfully!"
|
||||||
echo "========================================="
|
echo "========================================="
|
||||||
|
|
||||||
# Update stylix.nix to use this scheme
|
- name: Summary
|
||||||
sed -i "s/scheme = schemesFile\.schemes\.\w\+;/scheme = schemesFile.schemes.$scheme;/" config/stylix.nix
|
run: |
|
||||||
|
SCHEME_COUNT=$(echo "${{ steps.schemes.outputs.schemes }}" | wc -w)
|
||||||
# Verify the change
|
echo "✅ Color scheme builds completed successfully!"
|
||||||
grep "scheme = schemesFile.schemes" config/stylix.nix
|
echo "- Built $SCHEME_COUNT schemes: ${{ steps.schemes.outputs.schemes }}"
|
||||||
|
echo "- Pushed all builds to Atticd cache"
|
||||||
# Build the configuration
|
|
||||||
echo "Building $scheme..."
|
|
||||||
nix build .#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel \
|
|
||||||
--out-link ./result-$scheme \
|
|
||||||
--quiet
|
|
||||||
|
|
||||||
# Push to cache
|
|
||||||
echo "Pushing $scheme to cache..."
|
|
||||||
attic push servidos:nixos ./result-$scheme
|
|
||||||
|
|
||||||
# Also push using print-out-paths for better cache coverage
|
|
||||||
nix build .#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel \
|
|
||||||
--print-out-paths \
|
|
||||||
--quiet | attic push servidos:nixos --stdin
|
|
||||||
|
|
||||||
echo "✓ Completed $scheme"
|
|
||||||
echo ""
|
echo ""
|
||||||
done
|
echo "You can now switch schemes quickly without waiting for builds!"
|
||||||
|
|
||||||
# Restore original scheme
|
|
||||||
echo "Restoring original scheme: $ORIGINAL_SCHEME"
|
|
||||||
sed -i "s/scheme = schemesFile\.schemes\.\w\+;/scheme = schemesFile.schemes.$ORIGINAL_SCHEME;/" config/stylix.nix
|
|
||||||
|
|
||||||
echo "========================================="
|
|
||||||
echo "All schemes built and pushed successfully!"
|
|
||||||
echo "========================================="
|
|
||||||
|
|
||||||
- name: Summary
|
|
||||||
run: |
|
|
||||||
SCHEME_COUNT=$(echo "${{ steps.schemes.outputs.schemes }}" | wc -w)
|
|
||||||
echo "✅ Color scheme builds completed successfully!"
|
|
||||||
echo "- Built $SCHEME_COUNT schemes: ${{ steps.schemes.outputs.schemes }}"
|
|
||||||
echo "- Pushed all builds to Atticd cache"
|
|
||||||
echo ""
|
|
||||||
echo "You can now switch schemes quickly without waiting for builds!"
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user