diff options
author | Micah Lee <micah@micahflee.com> | 2023-10-20 19:26:03 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2023-10-20 19:26:03 -0700 |
commit | e98b1d683b6a39341dbe74c122126d6bc6d0becc (patch) | |
tree | 673f34dff74ed741f877946c8768179a9c70dee7 | |
parent | db3fb2967e04ce2fbb1bf70dd9ceb8484bd9d32d (diff) | |
download | onionshare-e98b1d683b6a39341dbe74c122126d6bc6d0becc.tar.gz onionshare-e98b1d683b6a39341dbe74c122126d6bc6d0becc.zip |
Try making snap cache work again
-rw-r--r-- | .github/workflows/build.yml | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3cb1775f..13463e42 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -261,32 +261,39 @@ jobs: steps: - uses: actions/checkout@v3 - # Change permissions before caching - - name: Set permissions for caching - run: sudo chmod -R 777 /var/snap/lxd/common/lxd/storage-pools/default - continue-on-error: true + - name: Initialize LXD/LXC + run: | + sudo lxd init --auto + sudo lxc storage list + + - name: Prepare cacheable directory + run: mkdir -p ~/lxd_cache - name: Restore cache - lxd uses: actions/cache@v3 with: - path: /var/snap/lxd/common/lxd/storage-pools/default + path: ~/lxd_cache key: snap-lxd-${{ hashFiles('snap/snapcraft.yaml') }} - # Restore original permissions after caching - - name: Restore permissions after caching - run: sudo chmod -R 755 /var/snap/lxd/common/lxd/storage-pools/default - continue-on-error: true + - name: Restore cached content to lxd directory + run: | + if [ -d "~/lxd_cache" ]; then + sudo rsync -a ~/lxd_cache/ /var/snap/lxd/common/lxd/storage-pools/default/ + fi - name: Install dependencies run: | - sudo lxd init --auto - sudo lxc storage list sudo snap install snapcraft --classic sudo ufw disable - name: Build snap run: sudo snapcraft + - name: Copy lxd directory to cacheable directory + run: | + sudo rsync -a /var/snap/lxd/common/lxd/storage-pools/default/ ~/lxd_cache/ + sudo chown -R $USER:$USER ~/lxd_cache/ + - uses: actions/upload-artifact@v3 with: name: snapcraft-build |