-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.36 KB
/
wsl-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Extract and Release WSL tarball
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Username must be lowercase
- name: Sanitize repo slug
uses: actions/github-script@v6
id: repo_slug
with:
result-encoding: string
script: return '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}'.toLowerCase()
- name: Set up Docker CLI
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract file system from container
id: run-container
run: |
docker create --name wsl-temp ${{ steps.repo_slug.outputs.result }}:wsl
docker export wsl-temp -o wsl_rootfs.tar
docker rm wsl-temp
docker run --name temp-container -d ${{ secrets.REGISTRY }}/${{ secrets.IMAGE_NAME }} sleep 3600
gzip -9 -v wsl_rootfs.tar
- name: release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # @v1
with:
files: |
./wsl_rootfs.tar.gz
draft: true
token: ${{ secrets.TOKEN }}