update github actions #72
Workflow file for this run
This file contains hidden or 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: Distro | |
| on: | |
| workflow_dispatch: | |
| push: | |
| env: | |
| TAG_NAME: ${{ format('wslvpnkit:{0}-{1}', github.sha, github.run_number) }} | |
| RUN_URL: ${{ format('{0}/{1}/actions/runs/{2}/attempts/{3}', github.server_url, github.repository, github.run_id, github.run_attempt) }} | |
| DOCKLE_HOST: "unix:///var/run/docker.sock" # https://github.com/Azure/container-scan/issues/146 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| checks: write | |
| steps: | |
| - uses: docker/setup-docker-action@v5 | |
| with: | |
| daemon-config: | | |
| { | |
| "debug": true, | |
| "features": { | |
| "containerd-snapshotter": true | |
| } | |
| } | |
| - uses: docker/setup-qemu-action@v4 | |
| - uses: docker/setup-buildx-action@v4 | |
| - uses: actions/checkout@v7 | |
| - uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./distro/alpine.dockerfile | |
| platforms: linux/arm64,linux/amd64 | |
| push: false | |
| load: true | |
| tags: ${{ env.TAG_NAME }} | |
| build-args: | | |
| REF=${{ env.RUN_URL }} | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| # https://github.com/anchore/scan-action/issues/542 | |
| - uses: anchore/scan-action@v7 | |
| with: | |
| image: image:${{ env.TAG_NAME }} | |
| output-format: table | |
| fail-build: false | |
| - name: Package amd64 | |
| run: | | |
| CONTAINER_ID=$(docker create --platform linux/amd64 ${{ env.TAG_NAME }}) | |
| docker export $CONTAINER_ID | gzip > wsl-vpnkit-amd64.tar.gz | |
| sha256sum wsl-vpnkit-amd64.tar.gz | tee wsl-vpnkit-amd64.tar.gz.sha256 | |
| ls -la wsl-vpnkit-amd64.tar.gz | |
| - name: Package arm64 | |
| run: | | |
| CONTAINER_ID=$(docker create --platform linux/arm64 ${{ env.TAG_NAME }}) | |
| docker export $CONTAINER_ID | gzip > wsl-vpnkit-arm64.tar.gz | |
| sha256sum wsl-vpnkit-arm64.tar.gz | tee wsl-vpnkit-arm64.tar.gz.sha256 | |
| ls -la wsl-vpnkit-arm64.tar.gz | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| path: | | |
| wsl-vpnkit-amd64.tar.gz | |
| wsl-vpnkit-amd64.tar.gz.sha256 | |
| wsl-vpnkit-arm64.tar.gz | |
| wsl-vpnkit-arm64.tar.gz.sha256 |