Merge pull request #86 from cloudflare/github-actions-osx #4
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: Debian build/release workflow | |
on: | |
push: | |
pull_request: | |
release: | |
types: [published] | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build wheel on debian-11.5 | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
python-version: ['3.9'] | |
steps: | |
- name: Initialization | |
run: | | |
rm -rf stpyv8 | |
pip uninstall -y stpyv8 | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt install libboost-dev libboost-system-dev libboost-iostreams-dev libboost-python-dev | |
pip install --upgrade pip setuptools wheel pytest | |
- name: Build wheel | |
run: | | |
python setup.py v8 | |
python setup.py sdist bdist_wheel -d stpyv8-debian-11-${{ matrix.python-version }} | |
cp v8/out.gn/x64.release.sample/icudtl.dat stpyv8-debian-11-${{ matrix.python-version }}/icudtl.dat | |
env: | |
V8_DEPS_LINUX: 0 | |
LDFLAGS: -L/usr/lib -L/usr/lib/x86_64-linux-gnu | |
- name: Install wheel | |
run : | | |
cp stpyv8-debian-11-${{ matrix.python-version }}/icudtl.dat /usr/share/stpyv8 | |
pip install --upgrade stpyv8-debian-11-${{ matrix.python-version }}/stpyv8*.whl | |
- name: Test wheel | |
run: | | |
pytest -v | |
- name: Create wheel zip | |
uses: vimtor/action-zip@v1.1 | |
with: | |
files: stpyv8-debian-11-${{ matrix.python-version }}/ | |
recursive: false | |
dest: stpyv8-debian-11-python-${{ matrix.python-version }}.zip | |
- name: Upload wheel zip | |
uses: actions/upload-artifact@v3 | |
if: ${{ github.event_name != 'release' }} | |
with: | |
name: wheels | |
path: stpyv8-debian-11-python-${{ matrix.python-version }}.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
files: 'stpyv8-debian-11-python-${{ matrix.python-version }}.zip' | |
token: ${{ secrets.GITHUB_TOKEN }} |