Skip to content

update wgpu to v0.17.0 (#282) #144

update wgpu to v0.17.0 (#282)

update wgpu to v0.17.0 (#282) #144

Workflow file for this run

# This workflow builds the binaries, which are released when a "v*" tag is pushed.
# These also include builds for 32bit platforms, which are thus tested as a side-effect.
# This workflow only runs on a push to master and when pushing a version-tag.
#
# The Linux builds are performed on a "manylinux" container. This container
# is designed such that that the resulting binary has minimal dependencies on system
# libraries, and thus works on as many linuxes as possible. It's a thing from the
# Python world, but generally useful.
#
# Each target (os + architecture) is build in a seperate job. This is kinda verbose,
# resulting in some duplication, but at least its easy to read and maintain.
# Don't forget to add new jobs to the needs of the publish job.
#
# Each job should specify at least these env vars:
# * TARGET: used in makefile to do cargo build --target $TARGET
# * ARCHIVE_NAME: used by the makefile to package things up
# * WGPU_NATIVE_VERSION: is backed into the binary at compile time
#
# See https://doc.rust-lang.org/nightly/rustc/platform-support.html for Rust build targets.
name: CD
on:
workflow_dispatch:
push:
tags: [ 'v*' ]
branches: [ trunk, cd ]
jobs:
# -----
linux-x86_64:
# Config
name: release - linux-x86_64
runs-on: ubuntu-latest
env:
TARGET: x86_64-unknown-linux-gnu
ARCHIVE_NAME: wgpu-linux-x86_64
TOOLCHAIN: stable-x86_64-unknown-linux-gnu
IMAGE: manylinux_2_28_x86_64
steps:
# Common part (same for nearly each build)
- uses: actions/checkout@v3
with:
submodules: true
- name: Set WGPU_NATIVE_VERSION
run: echo "WGPU_NATIVE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
# Build
- name: Build
run: |
CID=$(docker create -t -w /tmp/wgpu-native -v $PWD:/tmp/src:ro -e TARGET -e ARCHIVE_NAME -e WGPU_NATIVE_VERSION quay.io/pypa/$IMAGE bash -c "\
cp -r /tmp/src/. . && \
rm -rf ./dist && \
export PATH=/root/.cargo/bin:\$PATH && \
export USER=root && \
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none && \
rustup toolchain install --no-self-update $TOOLCHAIN && \
rustup default $TOOLCHAIN && \
dnf install clang-devel zip -y && \
make package")
docker start -ai $CID
mkdir -p dist
docker cp $CID:/tmp/wgpu-native/dist/. dist/.
docker rm $CID
# Upload (same for each build)
- name: Upload
uses: actions/upload-artifact@v3
with:
path: dist
name: dist
# -----
windows-x86_64:
# Config
name: release - windows-x86_64
runs-on: windows-latest
env:
TARGET: x86_64-pc-windows-msvc
ARCHIVE_NAME: wgpu-windows-x86_64
steps:
# Common part (same for each build)
- uses: actions/checkout@v3
with:
submodules: true
- name: Set WGPU_NATIVE_VERSION
run: echo "WGPU_NATIVE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable-msvc
targets: ${{ env.TARGET }}
# Build
- name: Install llvm
run: |
set -x
choco install -y llvm
echo "LIBCLANG_PATH=C:\Program Files\LLVM\lib" >> $GITHUB_ENV
shell: bash
- name: Build
run: make package
shell: bash
# Upload (same for each build)
- name: Upload
uses: actions/upload-artifact@v3
with:
path: dist
name: dist
# -----
windows-i686:
# Config
name: release - windows-i686
runs-on: windows-latest
env:
TARGET: i686-pc-windows-msvc
ARCHIVE_NAME: wgpu-windows-i686
steps:
# Common part (same for each build)
- uses: actions/checkout@v3
with:
submodules: true
- name: Set WGPU_NATIVE_VERSION
run: echo "WGPU_NATIVE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable-i686-pc-windows-msvc
targets: ${{ env.TARGET }}
# Build
- name: Install llvm
run: |
set -x
choco install -y --x86 --force llvm
echo "LIBCLANG_PATH=C:\Program Files (x86)\LLVM\lib" >> $GITHUB_ENV
shell: bash
- name: Build
run: make package
shell: bash
# Upload (same for each build)
- name: Upload
uses: actions/upload-artifact@v3
with:
path: dist
name: dist
# -----
macos-x86_64:
# Config
name: release - macos-x86_64
runs-on: macos-latest
env:
TARGET: x86_64-apple-darwin
ARCHIVE_NAME: wgpu-macos-x86_64
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
# Common part (same for each build)
- uses: actions/checkout@v3
with:
submodules: true
- name: Set WGPU_NATIVE_VERSION
run: echo "WGPU_NATIVE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ env.TARGET }}
# Build
- name: Select XCode version
run:
xcode_app=$(ls -1v /Applications/Xcode_*.app | tail -1)
echo $xcode_app
sudo xcode-select -s "$xcode_app"
- name: Build
run: make package
# Upload (same for each build)
- name: Upload
uses: actions/upload-artifact@v3
with:
path: dist
name: dist
# -----
macos-arm64:
# Config
name: release - macos-arm64
runs-on: macos-latest
env:
TARGET: aarch64-apple-darwin
ARCHIVE_NAME: wgpu-macos-arm64
steps:
# Common part (same for each build)
- uses: actions/checkout@v3
with:
submodules: true
- name: Set WGPU_NATIVE_VERSION
run: echo "WGPU_NATIVE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ env.TARGET }}
# Build
- name: Select XCode version
run:
xcode_app=$(ls -1v /Applications/Xcode_*.app | tail -1)
echo $xcode_app
sudo xcode-select -s "$xcode_app"
- name: Build
run: SDKROOT=$(xcrun -sdk macosx11.0 --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.0 --show-sdk-platform-version) make package
# Upload (same for each build)
- name: Upload
uses: actions/upload-artifact@v3
with:
path: dist
name: dist
# Create a Github release and upload the binary libs that we just built.
# There should be a release and debug build for each platform (win32, win64, MacOS64, Linux64),
# plus a file containing the commit sha.
publish:
name: Publish Github release
needs: [linux-x86_64, windows-x86_64, windows-i686, macos-x86_64, macos-arm64]
runs-on: ubuntu-latest
if: success() && contains(github.ref, 'tags/v')
steps:
- uses: actions/checkout@v3
- name: set version (which gets used as release name)
run: |
echo "WGPU_NATIVE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
shell: bash
- name: Download assets
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Create commit-sha file
env:
GITHUB_SHA: ${{ github.sha }}
run: |
echo $GITHUB_SHA > dist/commit-sha
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.WGPU_NATIVE_VERSION }}
name: ${{ env.WGPU_NATIVE_VERSION }}
files: |
dist/*.zip
dist/commit-sha
body: |
Autogenerated binary modules.
The Linux builds are built on AlmaLinux 8 [manylinux_2_28](https://github.com/pypa/manylinux#manylinux).
The MacOS builds target MacOS 10.13 High Sierra and up.
draft: false
prerelease: false