Extract and Release WSL tarball #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Extract and Release WSL tarball | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["Publish Docker Images"] | |
types: [completed] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
permissions: | |
contents: write | |
packages: read | |
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 | |
gzip -9 -v wsl_rootfs.tar | |
ls -pla | |
- name: release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # @v1 | |
with: | |
files: | | |
./wsl_rootfs.tar.gz | |
draft: true | |
token: ${{ secrets.GITHUB_TOKEN }} |