Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
Signed-off-by: ArchieMeng <[email protected]>
  • Loading branch information
ArchieMeng committed Feb 13, 2022
1 parent 8d75fe4 commit 05bdd23
Showing 1 changed file with 177 additions and 54 deletions.
231 changes: 177 additions & 54 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,83 @@ jobs:
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
ubuntu:

create-release:
needs:
- setup
name: Create Relase
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.setup.outputs.VERSION }}
release_name: Release ${{ needs.setup.outputs.VERSION }}
draft: true
prerelease: false

windows:
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10']
needs: [setup, create-release]
runs-on: windows-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-windows
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "VulkanSDK"
key: VulkanSDK-1.2.162.0-Installer
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/1.2.162.0/windows/VulkanSDK-1.2.162.0-Installer.exe?Human=true -OutFile VulkanSDK-1.2.162.0-Installer.exe
7z x -aoa ./VulkanSDK-1.2.162.0-Installer.exe -oVulkanSDK
Remove-Item .\VulkanSDK\Demos, .\VulkanSDK\Samples, .\VulkanSDK\Third-Party, .\VulkanSDK\Tools, .\VulkanSDK\Tools32, .\VulkanSDK\Bin32, .\VulkanSDK\Lib32 -Recurse
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Check Python version
run: |
python --version
- name: Install dependencies
run: |
pip install build
- name: Build
run: |
$env:VULKAN_SDK="$(pwd)\VulkanSDK"
python -m build -w .
- name: Package
run: |
mkdir ${{ env.PACKAGENAME }}
Copy-Item -Verbose -Path "README.md" -Destination "${{ env.PACKAGENAME }}"
Copy-Item -Verbose -Path "LICENSE" -Destination "${{ env.PACKAGENAME }}"
Copy-Item -Verbose -Recurse -Path dist\* -Destination "${{ env.PACKAGENAME }}"
7z a -r ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip ${{ env.PACKAGENAME }}
- name: Upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip
asset_name: ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip
asset_content_type: application/zip

ubuntu:
needs: [setup, create-release]
runs-on: ubuntu-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-ubuntu
Expand All @@ -33,7 +107,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-pip python3-venv libvulkan-dev swig glslang-dev glslang-tools
sudo apt-get install -y libvulkan-dev glslang-dev glslang-tools
pip install build
- name: Build
run: |
Expand All @@ -45,82 +119,131 @@ jobs:
cp -r dist/* ${{ env.PACKAGENAME }}
zip -9 -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}.zip
windows:
needs:
- setup
runs-on: windows-latest
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.PACKAGENAME }}.zip
asset_name: ${{ env.PACKAGENAME }}.zip
asset_content_type: application/zip

ubuntu-1804:
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ]
needs: [setup, create-release]
runs-on: ubuntu-18.04
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-windows
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-ubuntu1804
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Vulkan SDK
uses: humbletim/[email protected]

- uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Check Python version
run: |
python --version
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "1.2.162.0"
key: vulkansdk-linux-x86_64-1.2.162.0
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.2.162.0/linux/vulkansdk-linux-x86_64-1.2.162.0.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.162.0.tar.gz
tar -xf vulkansdk-linux-x86_64-1.2.162.0.tar.gz
rm -rf 1.2.162.0/source 1.2.162.0/samples
find 1.2.162.0 -type f | grep -v -E 'vulkan|glslang' | xargs rm
- name: Install dependencies
run: |
pip install build
- name: Build
run: |
export VULKAN_SDK=`pwd`/1.2.162.0/x86_64
python -m build -w .
- name: Package
run: |
mkdir ${{ env.PACKAGENAME }}
Copy-Item -Verbose -Path "README.md" -Destination "${{ env.PACKAGENAME }}"
Copy-Item -Verbose -Path "LICENSE" -Destination "${{ env.PACKAGENAME }}"
Copy-Item -Verbose -Recurse -Path dist\* -Destination "${{ env.PACKAGENAME }}"
7z a -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
mkdir -p ${{ env.PACKAGENAME }}
cp README.md LICENSE ${{ env.PACKAGENAME }}
cp -r dist/* ${{ env.PACKAGENAME }}
zip -9 -r ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip ${{ env.PACKAGENAME }}
- name: Upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}.zip
release:
needs:
- setup
- ubuntu
- windows
runs-on: ubuntu-latest
steps:
- name: Download
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.setup.outputs.VERSION }}
release_name: Release ${{ needs.setup.outputs.VERSION }}
draft: true
prerelease: false
- name: Upload (Ubuntu)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-ubuntu
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/${{ env.PACKAGENAME }}/${{ env.PACKAGENAME }}.zip
asset_name: ${{ env.PACKAGENAME }}.zip
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip
asset_name: ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip
asset_content_type: application/zip
- name: Upload (Windows)

macos:
needs: [setup, create-release]
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10']
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "vulkansdk-macos-1.2.162.0"
key: vulkansdk-macos-1.2.162.0
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.2.162.0/mac/vulkansdk-macos-1.2.162.0.dmg?Human=true -O vulkansdk-macos-1.2.162.0.dmg
hdiutil attach vulkansdk-macos-1.2.162.0.dmg
cp -r /Volumes/vulkansdk-macos-1.2.162.0 .
rm -rf vulkansdk-macos-1.2.162.0/Applications
find vulkansdk-macos-1.2.162.0 -type f | grep -v -E 'vulkan|glslang|MoltenVK' | xargs rm
hdiutil detach /Volumes/vulkansdk-macos-1.2.162.0
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Check Python version
run: |
python --version
- name: Install dependencies
run: |
pip install build
- name: Build
run: |
export VULKAN_SDK=`pwd`/vulkansdk-macos-1.2.162.0/macOS
export CMAKE_FLAGS="-DUSE_STATIC_MOLTENVK=ON -DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DVulkan_INCLUDE_DIR=`pwd`/vulkansdk-macos-1.2.162.0/MoltenVK/include \
-DVulkan_LIBRARY=`pwd`/vulkansdk-macos-1.2.162.0/MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a"
python -m build -w .
- name: Package
run: |
mkdir -p ${{ env.PACKAGENAME }}
cp README.md LICENSE ${{ env.PACKAGENAME }}
cp -r dist/* ${{ env.PACKAGENAME }}
zip -9 -r ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip ${{ env.PACKAGENAME }}
- name: Upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-windows
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/${{ env.PACKAGENAME }}/${{ env.PACKAGENAME }}.zip
asset_name: ${{ env.PACKAGENAME }}.zip
asset_content_type: application/zip
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip
asset_name: ${{ env.PACKAGENAME }}_${{ matrix.python-version }}.zip
asset_content_type: application/zip

0 comments on commit 05bdd23

Please sign in to comment.