Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 73 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ jobs:
- run: brew install coreutils #needed for shasum util
if: ${{ matrix.os == 'macOS-latest' }}
name: Install Dependencies for SHA Calculation (osx)

- run: |
file=$(ls)
file=$(ls | grep -v slim)
sha=$(sha256sum $file | awk '{ print $1 }')
echo "Computed sha256: $sha for $file"
echo "${{matrix.runtime}}-sha256=$sha" >> $GITHUB_OUTPUT
Comment on lines 109 to 113
Expand Down Expand Up @@ -283,6 +284,77 @@ jobs:
asset_name: actions-runner-linux-arm64-${{ steps.releaseNote.outputs.version }}.tar.gz
asset_content_type: application/octet-stream

# Upload release assets (slim runner packages)
- name: Upload Release Asset (slim win-x64)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}/actions-runner-slim-win-x64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_name: actions-runner-slim-win-x64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_content_type: application/octet-stream

- name: Upload Release Asset (slim win-arm64)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}/actions-runner-slim-win-arm64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_name: actions-runner-slim-win-arm64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_content_type: application/octet-stream

- name: Upload Release Asset (slim linux-x64)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}/actions-runner-slim-linux-x64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_name: actions-runner-slim-linux-x64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_content_type: application/octet-stream

- name: Upload Release Asset (slim osx-x64)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}/actions-runner-slim-osx-x64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_name: actions-runner-slim-osx-x64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_content_type: application/octet-stream

- name: Upload Release Asset (slim osx-arm64)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}/actions-runner-slim-osx-arm64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_name: actions-runner-slim-osx-arm64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_content_type: application/octet-stream

- name: Upload Release Asset (slim linux-arm)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}/actions-runner-slim-linux-arm-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_name: actions-runner-slim-linux-arm-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_content_type: application/octet-stream

- name: Upload Release Asset (slim linux-arm64)
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}/actions-runner-slim-linux-arm64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_name: actions-runner-slim-linux-arm64-${{ steps.releaseNote.outputs.version }}.tar.zst
asset_content_type: application/octet-stream

publish-image:
needs: release
runs-on: ubuntu-latest
Expand Down
11 changes: 8 additions & 3 deletions src/Runner.Common/HostContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,14 @@ public string GetDirectory(WellKnownDirectory directory)
break;

case WellKnownDirectory.Externals:
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root),
Constants.Path.ExternalsDirectory);
path = Environment.GetEnvironmentVariable("RUNNER_EXTERNALSDIRECTORY");

if (string.IsNullOrEmpty(path))
{
path = Path.Combine(
GetDirectory(WellKnownDirectory.Root),
Constants.Path.ExternalsDirectory);
}
Comment on lines +388 to +395
Comment on lines 387 to +395
break;

case WellKnownDirectory.Root:
Expand Down
16 changes: 15 additions & 1 deletion src/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ function package ()
# TODO: We are cross-compiling arm on x64 so we cant exec Runner.Listener. Remove after building on native arm host
runner_ver=$("${LAYOUT_DIR}/bin/Runner.Listener" --version) || runner_ver=$(cat runnerversion) || failed "version"
runner_pkg_name="actions-runner-${RUNTIME_ID}-${runner_ver}"
runner_slim_pkg_name="actions-runner-slim-${RUNTIME_ID}-${runner_ver}"

heading "Packaging ${runner_pkg_name}"

Expand All @@ -183,17 +184,30 @@ function package ()

pushd "$PACKAGE_DIR" > /dev/null

if [[ ("$CURRENT_PLATFORM" == "linux") || ("$CURRENT_PLATFORM" == "darwin") ]]; then
if [[ ("$CURRENT_PLATFORM" == "linux") ]]; then
tar_name="${runner_pkg_name}.tar.gz"
echo "Creating $tar_name in ${LAYOUT_DIR}"
tar -czf "${tar_name}" -C "${LAYOUT_DIR}" .
slim_tar_name="${runner_slim_pkg_name}.tar.zst"
echo "Creating $slim_tar_name in ${LAYOUT_DIR}"
tar -cf "${slim_tar_name}" -C "${LAYOUT_DIR}" --use-compress-program="zstd -19" --exclude="externals" .
elif [[ ("$CURRENT_PLATFORM" == "darwin") ]]; then
tar_name="${runner_pkg_name}.tar.gz"
echo "Creating $tar_name in ${LAYOUT_DIR}"
tar -czf "${tar_name}" -C "${LAYOUT_DIR}" .
slim_tar_name="${runner_slim_pkg_name}.tar.zst"
echo "Creating $slim_tar_name in ${LAYOUT_DIR}"
tar -cf "${slim_tar_name}" -C "${LAYOUT_DIR}" --zstd --options zstd:compression-level=19 --exclude="externals" .
elif [[ ("$CURRENT_PLATFORM" == "windows") ]]; then
zip_name="${runner_pkg_name}.zip"
echo "Convert ${LAYOUT_DIR} to Windows style path"
window_path=${LAYOUT_DIR:1}
window_path=${window_path:0:1}:${window_path:1}
echo "Creating $zip_name in ${window_path}"
$POWERSHELL -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "Add-Type -Assembly \"System.IO.Compression.FileSystem\"; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"${window_path}\", \"${zip_name}\")"
slim_tar_name="${runner_slim_pkg_name}.tar.zst"
echo "Creating $slim_tar_name in ${window_path}"
$POWERSHELL -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "\$env:ZSTD_CLEVEL=\"19\"; tar -cf \"${slim_tar_name}\" -C \"${window_path}\" --zstd --exclude=\"externals\" ."
fi

popd > /dev/null
Expand Down
Loading