-
Notifications
You must be signed in to change notification settings - Fork 84
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
1 parent
f9547df
commit 27b8441
Showing
1 changed file
with
103 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,103 @@ | ||
name: Windows Package Release | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
wheel_build: | ||
name: Build the wheels on Windows | ||
runs-on: ${{ matrix.os }} | ||
if: ${{ github.repository == 'opendilab/LightZero' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- 'windows-2019' | ||
- 'windows-2022' | ||
python: | ||
- '3.7' | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
architecture: | ||
- x86 | ||
- x64 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 20 | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: ${{ matrix.architecture }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade flake8 setuptools wheel twine | ||
if (Test-Path requirements.txt) { pip install -r requirements.txt } | ||
if (Test-Path requirements-build.txt) { pip install -r requirements-build.txt } | ||
if (Test-Path requirements-test.txt) { pip install -r requirements-test.txt } | ||
pip install --upgrade build | ||
- name: Build wheels | ||
run: | | ||
python setup.py bdist_wheel | ||
mkdir dist | ||
mv dist\*.whl dist\ | ||
- name: Show the buildings | ||
shell: bash | ||
run: | | ||
ls -al .\dist | ||
- name: Upload packed files to artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build-artifacts-windows | ||
path: .\dist\* | ||
|
||
# the publishing can only be processed on linux system | ||
wheel_publish: | ||
name: Publish the wheels to pypi | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- wheel_build | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: | ||
- '3.8.7' | ||
|
||
steps: | ||
- name: Download packed files to artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build-artifacts-windows | ||
path: ./dist | ||
- name: Show the buildings | ||
shell: bash | ||
run: | | ||
ls -al ./dist | ||
- name: Upload distribution 📦 to github release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: dist/* | ||
tag: ${{ github.ref }} | ||
overwrite: false | ||
file_glob: true | ||
- name: Publish distribution 📦 to real PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
verbose: true | ||
skip_existing: true | ||
packages_dir: dist/ |