test nixcp
use nixcp to upload machines as result
This commit is contained in:
parent
477d94687d
commit
5cb9e61708
2 changed files with 37 additions and 61 deletions
69
.github/workflows/build-machines-and-homes.yml
vendored
69
.github/workflows/build-machines-and-homes.yml
vendored
|
@ -39,25 +39,6 @@ jobs:
|
||||||
- name: setup binary cache key
|
- name: setup binary cache key
|
||||||
run: echo -n "${{ secrets.NIX_CACHE_SECRET_KEY }}" | xxd -p -r > ${{ runner.temp }}/cache-priv-key.pem
|
run: echo -n "${{ secrets.NIX_CACHE_SECRET_KEY }}" | xxd -p -r > ${{ runner.temp }}/cache-priv-key.pem
|
||||||
|
|
||||||
- name: Sync repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: post-build-hook
|
|
||||||
run: |
|
|
||||||
sudo mkdir -p /etc/nix
|
|
||||||
sudo cp ci/upload-to-cache.sh /etc/nix/
|
|
||||||
sudo chmod +x /etc/nix/upload-to-cache.sh
|
|
||||||
|
|
||||||
- name: setup s3 credentials
|
|
||||||
run: |
|
|
||||||
sudo mkdir /root/.aws
|
|
||||||
echo "[default]" |sudo tee /root/.aws/config |sudo tee /root/.aws/credentials
|
|
||||||
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" |sudo tee -a /root/.aws/credentials
|
|
||||||
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" |sudo tee -a /root/.aws/credentials
|
|
||||||
echo "endpoint_url=$AWS_ENDPOINT_URL" |sudo tee -a /root/.aws/config
|
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v30
|
uses: cachix/install-nix-action@v30
|
||||||
with:
|
with:
|
||||||
|
@ -70,13 +51,26 @@ jobs:
|
||||||
secret-key-files = ${{ runner.temp }}/cache-priv-key.pem
|
secret-key-files = ${{ runner.temp }}/cache-priv-key.pem
|
||||||
extra-substituters = https://nixcache.cy7.sh
|
extra-substituters = https://nixcache.cy7.sh
|
||||||
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
|
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
|
||||||
post-build-hook = /etc/nix/upload-to-cache.sh
|
|
||||||
download-buffer-size = 1073741824
|
download-buffer-size = 1073741824
|
||||||
|
|
||||||
|
- name: Sync repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
nix run nixpkgs#nixos-rebuild build -- -L --flake ".#${{ matrix.machine }}"
|
nix run nixpkgs#nixos-rebuild build -- -L --flake ".#${{ matrix.machine }}"
|
||||||
|
|
||||||
|
- name: cache
|
||||||
|
run: |
|
||||||
|
nix run \
|
||||||
|
github:cything/nixcp/test-in-ci -- push \
|
||||||
|
--bucket nixcache \
|
||||||
|
--endpoint $AWS_ENDPOINT_URL \
|
||||||
|
--signing-key ${{ runner.temp }}/cache-priv-key.pem \
|
||||||
|
result
|
||||||
|
|
||||||
build-homes:
|
build-homes:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
@ -86,7 +80,6 @@ jobs:
|
||||||
- yt@chunk
|
- yt@chunk
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
# - macos-latest
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -105,25 +98,6 @@ jobs:
|
||||||
- name: setup binary cache key
|
- name: setup binary cache key
|
||||||
run: echo -n "${{ secrets.NIX_CACHE_SECRET_KEY }}" | xxd -p -r > ${{ runner.temp }}/cache-priv-key.pem
|
run: echo -n "${{ secrets.NIX_CACHE_SECRET_KEY }}" | xxd -p -r > ${{ runner.temp }}/cache-priv-key.pem
|
||||||
|
|
||||||
- name: Sync repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: post-build-hook
|
|
||||||
run: |
|
|
||||||
sudo mkdir -p /etc/nix
|
|
||||||
sudo cp ci/upload-to-cache.sh /etc/nix/
|
|
||||||
sudo chmod +x /etc/nix/upload-to-cache.sh
|
|
||||||
|
|
||||||
- name: setup s3 credentials
|
|
||||||
run: |
|
|
||||||
sudo mkdir /root/.aws
|
|
||||||
echo "[default]" |sudo tee /root/.aws/config |sudo tee /root/.aws/credentials
|
|
||||||
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" |sudo tee -a /root/.aws/credentials
|
|
||||||
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" |sudo tee -a /root/.aws/credentials
|
|
||||||
echo "endpoint_url=$AWS_ENDPOINT_URL" |sudo tee -a /root/.aws/config
|
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v30
|
uses: cachix/install-nix-action@v30
|
||||||
with:
|
with:
|
||||||
|
@ -136,10 +110,23 @@ jobs:
|
||||||
secret-key-files = ${{ runner.temp }}/cache-priv-key.pem
|
secret-key-files = ${{ runner.temp }}/cache-priv-key.pem
|
||||||
extra-substituters = https://nixcache.cy7.sh
|
extra-substituters = https://nixcache.cy7.sh
|
||||||
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
|
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
|
||||||
post-build-hook = /etc/nix/upload-to-cache.sh
|
|
||||||
download-buffer-size = 1073741824
|
download-buffer-size = 1073741824
|
||||||
|
|
||||||
|
- name: Sync repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
||||||
nix build -L "$package"
|
nix build -L "$package"
|
||||||
|
|
||||||
|
- name: cache
|
||||||
|
run: |
|
||||||
|
nix run \
|
||||||
|
github:cything/nixcp/test-in-ci -- push \
|
||||||
|
--bucket nixcache \
|
||||||
|
--endpoint $AWS_ENDPOINT_URL \
|
||||||
|
--signing-key ${{ runner.temp }}/cache-priv-key.pem \
|
||||||
|
result
|
||||||
|
|
29
.github/workflows/build-packages.yml
vendored
29
.github/workflows/build-packages.yml
vendored
|
@ -32,25 +32,6 @@ jobs:
|
||||||
- name: setup binary cache key
|
- name: setup binary cache key
|
||||||
run: echo -n "${{ secrets.NIX_CACHE_SECRET_KEY }}" | xxd -p -r > ${{ runner.temp }}/cache-priv-key.pem
|
run: echo -n "${{ secrets.NIX_CACHE_SECRET_KEY }}" | xxd -p -r > ${{ runner.temp }}/cache-priv-key.pem
|
||||||
|
|
||||||
- name: Sync repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: post-build-hook
|
|
||||||
run: |
|
|
||||||
sudo mkdir -p /etc/nix
|
|
||||||
sudo cp ci/upload-to-cache.sh /etc/nix/
|
|
||||||
sudo chmod +x /etc/nix/upload-to-cache.sh
|
|
||||||
|
|
||||||
- name: setup s3 credentials
|
|
||||||
run: |
|
|
||||||
sudo mkdir /root/.aws
|
|
||||||
echo "[default]" |sudo tee /root/.aws/config |sudo tee /root/.aws/credentials
|
|
||||||
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" |sudo tee -a /root/.aws/credentials
|
|
||||||
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" |sudo tee -a /root/.aws/credentials
|
|
||||||
echo "endpoint_url=$AWS_ENDPOINT_URL" |sudo tee -a /root/.aws/config
|
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v30
|
uses: cachix/install-nix-action@v30
|
||||||
with:
|
with:
|
||||||
|
@ -63,10 +44,18 @@ jobs:
|
||||||
secret-key-files = ${{ runner.temp }}/cache-priv-key.pem
|
secret-key-files = ${{ runner.temp }}/cache-priv-key.pem
|
||||||
extra-substituters = https://nixcache.cy7.sh
|
extra-substituters = https://nixcache.cy7.sh
|
||||||
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
|
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
|
||||||
post-build-hook = /etc/nix/upload-to-cache.sh
|
|
||||||
|
|
||||||
- run: nix build -L ${{ matrix.package }}
|
- run: nix build -L ${{ matrix.package }}
|
||||||
|
|
||||||
|
- name: cache
|
||||||
|
run: |
|
||||||
|
nix run \
|
||||||
|
github:cything/nixcp/test-in-ci -- push \
|
||||||
|
--bucket nixcache \
|
||||||
|
--endpoint $AWS_ENDPOINT_URL \
|
||||||
|
--signing-key ${{ runner.temp }}/cache-priv-key.pem \
|
||||||
|
result
|
||||||
|
|
||||||
- name: prepare tarball to upload
|
- name: prepare tarball to upload
|
||||||
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
|
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue