cicd #129
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: cicd | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build wheels ${{ matrix.os }} ${{ matrix.py }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-14"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: prep pysqlcipher3 | |
run: | | |
git clone --depth=1 --branch=master https://github.com/rigglemania/pysqlcipher3.git | |
cd pysqlcipher3 | |
mkdir amalgamation | |
cp ../sqlcipher/sqlite3.[ch] amalgamation | |
mkdir src/python3/sqlcipher | |
cp ../sqlcipher/sqlite3.[ch] src/python3/sqlcipher | |
pip install setuptools | |
- name: build pysqlcipher3 linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cd pysqlcipher3 | |
python setup.py build_amalgamation | |
python setup.py build | |
- name: Set up Homebrew | |
if: matrix.os == 'macos-14' | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: build pysqlcipher3 macOS | |
if: matrix.os == 'macos-14' | |
run: | | |
brew install openssl | |
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib" | |
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include" | |
cd pysqlcipher3 | |
python setup.py build_amalgamation | |
python setup.py build | |
- name: post-build pysqlcipher3 | |
run: | | |
mkdir src/pysqlcipher3 | |
for f in pysqlcipher3/build/lib.*/pysqlcipher3/*.{py,so}; do cp $f src/pysqlcipher3/; done | |
- name: build | |
run: | | |
pip install build | |
python -m build | |
PLATFORM_TAG=$(python -c 'import sysconfig; print(sysconfig.get_platform().replace("-", "_")') | |
cd dist | |
NEW_NAME=$(ls *.whl | sed "s/any.whl$/${PLATFORM_TAG}.whl/") | |
mv *.whl $NEW_NAME | |
echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_ENV | |
- name: test | |
run: | | |
pip install dist/*.whl pytest | |
pytest | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.WHEEL_NAME }} | |
path: "dist/*.whl" | |
# - name: Publish | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# password: ${{ secrets.PYPI_API_TOKEN }} | |
# skip_existing: true |