-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: π¦ Building wheels | ||
|
||
on: | ||
workflow_dispatch: | ||
# push: | ||
# tags: | ||
# - "v*" | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
platform: win32 | ||
arch: x64 | ||
# - os: macos-latest | ||
# platform: darwin | ||
# arch: arm64 | ||
- os: ubuntu-latest | ||
platform: linux | ||
arch: x64 | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
archive_name: deps-wheels_${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.arch }} | ||
steps: | ||
- name: β»οΈ Checking out the repository | ||
uses: actions/checkout@v3 | ||
- name: "π Setting up Python" | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10.9" | ||
|
||
- name: π¦ Building and Bundling wheels | ||
shell: bash | ||
run: | | ||
python -m pip wheel --no-cache-dir -r requirements-wheels.txt -w ./wheels > build.log | ||
cat build.log | ||
# find source wheels | ||
packages=$(cat build.log | awk -F 'Building wheels for collected packages: ' '{print $2}') | ||
packages=$(echo "$packages" | tr -d '[:space:]') | ||
IFS=', ' read -r -a package_array <<< "$packages" | ||
printf "Autodetect this source package: \e[32m%s\e[0m\n" "${package_array[@]}" | ||
# Iterate through the wheel files and remove those that are not source built | ||
for wheel_file in ./wheels/*.whl; do | ||
# Extract the package name from the wheel filename | ||
package_name=$(basename "$wheel_file" .whl | awk -F '-' '{print $1}') | ||
printf "Checking package: %s\n" "$package_name" | ||
# Check if the package is not in the array of source built packages | ||
if [[ ! " ${package_array[@]} " =~ " ${package_name} " ]]; then | ||
echo "Removing $wheel_file" | ||
rm "$wheel_file" | ||
fi | ||
done | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
"C:/Program Files/7-Zip/7z.exe" a -mfb=258 -tzip ${{ env.archive_name }}.zip wheels | ||
else | ||
zip -r -9 -y -m ${{ env.archive_name }}.zip wheels | ||
fi | ||
- name: πΎ Store cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: ${{ env.archive_name }}.zip | ||
key: ${{ env.archive_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: π¦ Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: Release tag / name ? | ||
required: true | ||
default: "latest" | ||
type: string | ||
environment: | ||
description: Environment to run tests against | ||
type: environment | ||
required: false | ||
# push: | ||
# tags: | ||
# - "v*" | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
env: | ||
repo_name: ${{ github.event.repository.name }} | ||
steps: | ||
- name: β»οΈ Checking out the repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: "recursive" | ||
path: ${{ env.repo_name }} | ||
- name: π¦ Building custom comfy nodes | ||
shell: bash | ||
run: | | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
"C:/Program Files/7-Zip/7z.exe" a -mfb=258 -tzip ${{ env.repo_name }}-${{ inputs.name }}.zip ${{ env.repo_name }} | ||
else | ||
zip -r -9 -y -m ${{ env.repo_name }}-${{ inputs.name }}.zip ${{ env.repo_name }} | ||
fi | ||
- name: β Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ inputs.name }} | ||
files: | | ||
${{ env.repo_name }}-${{ inputs.name }}.zip | ||
release-wheels: | ||
permissions: | ||
contents: write | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
platform: win32 | ||
arch: x64 | ||
# - os: macos-latest | ||
# platform: darwin | ||
# arch: arm64 | ||
- os: ubuntu-latest | ||
platform: linux | ||
arch: x64 | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
archive_name: deps-wheels_${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.arch }} | ||
steps: | ||
- name: πΎ Restore cache | ||
uses: actions/cache/restore@v3 | ||
id: cache | ||
with: | ||
path: ${{ env.archive_name }}.zip | ||
key: ${{ env.archive_name }} | ||
- name: β Add wheels to release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ inputs.name }} | ||
files: | | ||
${{ env.archive_name }}.zip |