mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-12 21:06:23 +02:00
Tar entire build environment
This commit is contained in:
parent
f90136c9a3
commit
b649ed3727
1 changed files with 8 additions and 24 deletions
32
.github/workflows/ci.yml
vendored
32
.github/workflows/ci.yml
vendored
|
@ -61,20 +61,15 @@ jobs:
|
||||||
- name: Populate `/nix/store`
|
- name: Populate `/nix/store`
|
||||||
run: nix develop --command true
|
run: nix develop --command true
|
||||||
|
|
||||||
- name: Package `/nix/store` for Artifact
|
- name: Package build environment for Artifact
|
||||||
run: |
|
run: |
|
||||||
tar -czf nix-store.tar.gz /nix/store
|
sudo tar -czf environment.tar.gz /nix/store ~/.cargo /etc/nix/nix.conf $HOME/.direnvrc
|
||||||
|
|
||||||
# Store the build environment in an artifact
|
- name: Store build environment
|
||||||
- name: Cache build environment
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-environment
|
name: build-environment
|
||||||
path: |
|
path: environment.tar.gz
|
||||||
nix-store.tar.gz
|
|
||||||
~/.cargo
|
|
||||||
$HOME/.direnvrc
|
|
||||||
/etc/nix/nix.conf
|
|
||||||
|
|
||||||
build_and_package:
|
build_and_package:
|
||||||
needs: setup
|
needs: setup
|
||||||
|
@ -92,31 +87,20 @@ jobs:
|
||||||
]
|
]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download Build Environment
|
- name: Download build environment
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-environment
|
name: build-environment
|
||||||
|
|
||||||
- name: Extract Nix Store Archive
|
- name: Extract build environment
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ${{ github.workspace }}/nix-store
|
tar -xzf nix-store.tar.gz -C /
|
||||||
tar -xzf nix-store.tar.gz -C ${{ github.workspace }}/nix-store
|
|
||||||
|
|
||||||
- name: Move Nix Store to Proper Location
|
|
||||||
run: |
|
|
||||||
sudo rsync -a ${{ github.workspace }}/nix-store/ /nix/store/
|
|
||||||
sudo chown -R root:root /nix/store
|
|
||||||
sudo restorecon -Rv /nix/store # If SELinux is enforcing
|
|
||||||
|
|
||||||
- name: Sync repository
|
- name: Sync repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Reuse Build Environment
|
- name: Reuse build environment
|
||||||
run: |
|
run: |
|
||||||
# Ensure the nix configuration is correct
|
|
||||||
sudo cp -R /etc/nix/nix.conf /etc/nix/nix.conf.bak
|
|
||||||
sudo cp -R nix.conf /etc/nix/nix.conf
|
|
||||||
# Source direnv
|
|
||||||
source $HOME/.direnvrc
|
source $HOME/.direnvrc
|
||||||
direnv allow
|
direnv allow
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue