2023.10.4 #86
Workflow file for this run
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
name: Publish to PyPI.org | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-nim: | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/buildnim | |
- name: Cache Unix | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "nimlite-unix" | |
path: | | |
${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.so | |
- name: Cache Windows | |
if: runner.os == 'Windows' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "nimlite-windows" | |
path: | | |
${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.pyd | |
pypi: | |
needs: [build-nim] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set Environment Variables | |
uses: allenevans/[email protected] | |
with: | |
NIMLITE_DIR: 'nimlite' | |
NIM_PACKAGE_NAME: 'libnimlite' | |
- name: Cache Restore Unix | |
uses: actions/download-artifact@v3 | |
with: | |
name: nimlite-unix | |
path: | | |
${{ env.NIMLITE_DIR }} | |
- name: Cache Restore Windows | |
uses: actions/download-artifact@v3 | |
with: | |
name: nimlite-windows | |
path: | | |
${{ env.NIMLITE_DIR }} | |
- name: install python | |
run: | | |
python3 -m pip install --upgrade build | |
- name: build wheel | |
run: | | |
python3 -m build --wheel | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |