Skip to content

Commit e65c4ae

Browse files
committed
use Arsenal Image Mounter
1 parent c2ac92d commit e65c4ae

File tree

1 file changed

+22
-30
lines changed

1 file changed

+22
-30
lines changed

action.yml

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,52 @@
1-
name: "Setup ImDisk"
1+
name: "Setup Arsenal Image Mounter"
22
if: runner.os == 'Windows'
33
description: |
4-
Sets up the ImDisk toolkit for Windows and backs often-used paths with RAM disks
4+
Sets up the Arsenal Image Mounter for Windows and backs often-used paths with RAM disks
55
runs:
66
using: "composite"
77
steps:
8-
- name: Download ImDisk
9-
if: runner.os == 'Windows'
8+
- name: Download and install Arsenal Image Mounter
109
shell: bash
1110
run: |
12-
mkdir imdisk
13-
cd imdisk
14-
curl -L -o files.cab https://github.com/coder/imdisk-artifacts/raw/92a17839ebc0ee3e69be019f66b3e9b5d2de4482/files.cab
15-
curl -L -o install.bat https://github.com/coder/imdisk-artifacts/raw/92a17839ebc0ee3e69be019f66b3e9b5d2de4482/install.bat
16-
cd ..
11+
set -e
1712
18-
- name: Install ImDisk
19-
shell: cmd
20-
run: |
21-
cd imdisk
22-
install.bat /silent
13+
cd ~/
14+
15+
mkdir aim
16+
cd aim
17+
curl -L -o aim_ll.zip https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/5961f922c5b99ec29acc4af4b60b909b402eed95/Command%20line%20applications/aim_ll.zip
18+
# unzip properly extracts everything but warns that "aim_ll.zip appears to use backslashes as path separators"
19+
# it then exits with a non-zero status code. the warning is harmless, so we ignore it.
20+
unzip aim_ll.zip || true
21+
mkdir ~/bin
22+
mv x64/* ~/bin
23+
24+
curl -L -o DriverFiles.zip https://github.com/ArsenalRecon/Arsenal-Image-Mounter/raw/5961f922c5b99ec29acc4af4b60b909b402eed95/DriverSetup/DriverFiles.zip
25+
# like above
26+
unzip DriverFiles.zip -d DriverFiles || true
27+
aim_ll --install DriverFiles
2328
2429
- name: Create RAM Disks
2530
shell: bash
2631
run: |
2732
# RAM disk for postgres mounted on R:
28-
imdisk -a -s 4096M -m R: -p "/fs:ntfs /q /y"
33+
aim_ll -a -s "90%" -m R: -p "/fs:ntfs /q /y"
2934
3035
# RAM disk for temp files. It's used by actions/cache, actions/setup-go, etc.
3136
# We need to persist the existing contents because some actions rely on it.
3237
mkdir "$RUNNER_TEMP"_tmp
3338
cp -r "$RUNNER_TEMP"/. "$RUNNER_TEMP"_tmp
3439
rm -rf "$RUNNER_TEMP"/*
35-
imdisk -a -s 8192M -m "$RUNNER_TEMP" -p "/fs:ntfs /q /y"
40+
aim_ll -a -s "90%" -m "$RUNNER_TEMP" -p "/fs:ntfs /q /y"
3641
cp -r "$RUNNER_TEMP"_tmp/. "$RUNNER_TEMP"
3742
rm -rf "$RUNNER_TEMP"_tmp
3843
39-
# RAM disk for go cache and mod cache
40-
# cd to another directory to ensure we're not inside a go project.
41-
# That'd trigger go to download the toolchain for that project.
42-
cd "$RUNNER_TEMP"
43-
export GOCACHE="$(go env GOCACHE)"
44-
export GOMODCACHE="$(go env GOMODCACHE)"
45-
rm -rf "$GOCACHE"
46-
rm -rf "$GOMODCACHE"
47-
mkdir -p "$GOCACHE"
48-
mkdir -p "$GOMODCACHE"
49-
imdisk -a -s 8192M -m "$GOCACHE" -p "/fs:ntfs /q /y"
50-
imdisk -a -s 8192M -m "$GOMODCACHE" -p "/fs:ntfs /q /y"
51-
5244
# RAM disk for the repository
5345
rm -rf "$GITHUB_WORKSPACE"/*
5446
# Use exfat instead of ntfs because ntfs creates an unremovable
5547
# "System Volume Information" directory that makes actions/checkout fail.
5648
# exfat is empty on creation
57-
imdisk -a -s 2048M -m "$GITHUB_WORKSPACE" -p "/fs:exfat /q /y"
49+
aim_ll -a -s "90%" -m "$GITHUB_WORKSPACE" -p "/fs:exfat /q /y"
5850
# node's fs.promises.readdir used by actions/checkout fails if the
5951
# directory is empty.
6052
touch "$GITHUB_WORKSPACE"/dummy.txt

0 commit comments

Comments
 (0)