Skip to content

minor patch

minor patch #74

Workflow file for this run

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: jiro4989/setup-nim-action@v1
with:
nim-version: "2.0.0"
- name: Nimble Install dependencies
run: |
nimble -y refresh
nimble -y install nimpy argparse
- name: Set Environment Variables
uses: allenevans/[email protected]
with:
NIMLITE_DIR: 'tablite/_nimlite'
NIM_PACKAGE_NAME: 'nimlite'
TABLITE_PACKAGE_NAME: 'tablite'
NIMC_FLAGS: '--app:lib --threads:on -d:release -d:danger'
- name: Compile Debug & import (Unix)
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
# compile the nimlite
nim c ${{ env.NIMC_FLAGS }} --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.so ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim
- name: Compile Debug & import (Windows)
if: runner.os == 'Windows'
run: |
# compile the nimlite
nim c ${{ env.NIMC_FLAGS }} --tlsEmulation:off --passL:-static --out:${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.pyd ${{ env.NIMLITE_DIR }}/${{ env.NIM_PACKAGE_NAME }}.nim
- 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: 'tablite/_nimlite'
NIM_PACKAGE_NAME: 'nimlite'
- 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 }}