Skip to content

Commit

Permalink
Add release step to the build workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Stankiewicz <[email protected]>
  • Loading branch information
p1-0tr committed Sep 13, 2024
1 parent 7047ca1 commit d819af7
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
release:
description: 'Publish artifacts produced by this job'
required: false
type: boolean
default: false

jobs:
build_linux:
Expand Down Expand Up @@ -41,15 +48,15 @@ jobs:
- name: Upload Linux runtime artifacts
uses: actions/upload-artifact@v4
with:
name: com.docker.docker.webgpu-runtime.linux
name: com.docker.webgpu-runtime.linux
path: out-runtime/*
retention-days: 2
if-no-files-found: error

- name: Upload Linux client artifacts
uses: actions/upload-artifact@v4
with:
name: libwebgpu
name: libwebgpu.linux
path: out-client/*
retention-days: 2
if-no-files-found: error
Expand Down Expand Up @@ -96,7 +103,43 @@ jobs:
- name: Upload macOS runtime artifacts
uses: actions/upload-artifact@v4
with:
name: com.docker.docker.webgpu-runtime.darwin
name: com.docker.webgpu-runtime.darwin
path: ${{ steps.strings.outputs.build-output-dir }}/src/server/com.docker.webgpu-runtime
retention-days: 2
if-no-files-found: error

release:
if: inputs.release && github.actor == 'p1-0tr'
runs-on: ubuntu-latest
needs: [build_linux, build_macos]
steps:
- name: Download built artifacts
uses: actions/download-artifact@v4
with:
path: 'pipeline-artifacts'
- name: Tidy up directory structure
shell: bash
run: |
mkdir -p release-artifacts/linux/amd64
mkdir -p release-artifacts/linux/arm64
mkdir -p release-artifacts/darwin/arm64
mv pipeline-artifacts/com.docker.webgpu-runtime.linux/linux_amd64/* release-artifacts/linux/amd64/.
mv pipeline-artifacts/com.docker.webgpu-runtime.linux/linux_arm64/* release-artifacts/linux/arm64/.
mv pipeline-artifacts/com.docker.webgpu-runtime.darwin/* release-artifacts/darwin/arm64/.
pushd pipeline-artifacts/libwebgpu.linux
for libc in musl glibc; do
for arch in amd64 arm64; do
pushd "${libc}/linux_${arch}"
tar -czvf libwebgpu.${libc}.${arch}.tar.gz include libwebgpudd.so
mv libwebgpu.${libc}.${arch}.tar.gz ../../../../release-artifacts/linux/${arch}/.
popd
done
done
- name: Publish artifacts
uses: ncipollo/release-action@v1
with:
artifacts: 'release-artifacts/*'
generateReleaseNotes: false
draft: true
commit: 'main'
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d819af7

Please sign in to comment.