build.yml (pacparser-1.3.9) | : | build.yml (pacparser-1.4.0) | ||
---|---|---|---|---|
name: Build Pacparser | name: Build Pacparser | |||
on: | on: | |||
push: | push: | |||
branches: [ master ] | branches: [ master ] | |||
paths: | paths: | |||
- 'src/**' | - 'src/**' | |||
- '.github/workflows/build.yml' | - '.github/workflows/build.yml' | |||
pull_request: | pull_request: | |||
workflow_dispatch: | ||||
inputs: | ||||
tag: | ||||
description: 'Tag to run workflow for' | ||||
required: true | ||||
jobs: | jobs: | |||
build: | build: | |||
strategy: | strategy: | |||
matrix: | matrix: | |||
os: [ubuntu-latest, windows-latest, macos-latest] | os: [ubuntu-latest, windows-latest, macos-latest] | |||
runs-on: ${{ matrix.os }} | runs-on: ${{ matrix.os }} | |||
steps: | steps: | |||
- uses: actions/checkout@v2 | - uses: actions/checkout@v2 | |||
if: ${{ !contains(github.event_name, 'workflow_dispatch') }} | ||||
with: | with: | |||
fetch-depth: 0 | fetch-depth: 0 | |||
- name: Check out code for workflow_dispatch | ||||
if: ${{ contains(github.event_name, 'workflow_dispatch') }} | ||||
uses: actions/checkout@v2 | ||||
with: | ||||
fetch-depth: 0 | ||||
ref: ${{ github.event.inputs.tag }} | ||||
- name: make non-windows | - name: make non-windows | |||
if: ${{ matrix.os != 'windows-latest' }} | if: ${{ matrix.os != 'windows-latest' }} | |||
run: make -C src | run: make -C src | |||
- name: make windows | - name: make windows | |||
if: ${{ matrix.os == 'windows-latest' }} | if: ${{ matrix.os == 'windows-latest' }} | |||
run: make -C src -f Makefile.win32 | run: make -C src -f Makefile.win32 | |||
- name: make non-windows dist | - name: make non-windows dist | |||
if: ${{ matrix.os != 'windows-latest' }} | if: ${{ matrix.os != 'windows-latest' }} | |||
skipping to change at line 57 | skipping to change at line 70 | |||
python-module-build: | python-module-build: | |||
strategy: | strategy: | |||
matrix: | matrix: | |||
os: [ubuntu-latest, windows-latest, macos-latest] | os: [ubuntu-latest, windows-latest, macos-latest] | |||
python-version: ['3.7', '3.8', '3.9', '3.10'] | python-version: ['3.7', '3.8', '3.9', '3.10'] | |||
runs-on: ${{ matrix.os }} | runs-on: ${{ matrix.os }} | |||
steps: | steps: | |||
- uses: actions/checkout@v2 | - uses: actions/checkout@v2 | |||
if: ${{ !contains(github.event_name, 'workflow_dispatch') }} | ||||
with: | with: | |||
fetch-depth: 0 | fetch-depth: 0 | |||
- name: Check out code for workflow_dispatch | ||||
if: ${{ contains(github.event_name, 'workflow_dispatch') }} | ||||
uses: actions/checkout@v2 | ||||
with: | ||||
fetch-depth: 0 | ||||
ref: ${{ github.event.inputs.tag }} | ||||
- name: Set up Python | - name: Set up Python | |||
uses: actions/setup-python@v3 | uses: actions/setup-python@v3 | |||
with: | with: | |||
python-version: ${{ matrix.python-version }} | python-version: ${{ matrix.python-version }} | |||
architecture: x64 | architecture: x64 | |||
- name: make non-windows | - name: make non-windows | |||
if: ${{ matrix.os != 'windows-latest' }} | if: ${{ matrix.os != 'windows-latest' }} | |||
run: make -C src pymod-dist | run: make -C src pymod-dist | |||
skipping to change at line 86 | skipping to change at line 107 | |||
with: | with: | |||
name: pacparser-python-${{ matrix.python-version }}-${{ matrix.os }}-dis t | name: pacparser-python-${{ matrix.python-version }}-${{ matrix.os }}-dis t | |||
path: src/pymod/pacparser-python* | path: src/pymod/pacparser-python* | |||
- name: Build wheel non-linux | - name: Build wheel non-linux | |||
if: ${{ matrix.os != 'ubuntu-latest' }} | if: ${{ matrix.os != 'ubuntu-latest' }} | |||
run: | | run: | | |||
python -m pip install wheel | python -m pip install wheel | |||
cd src/pymod && python setup.py bdist_wheel | cd src/pymod && python setup.py bdist_wheel | |||
- uses: dorny/paths-filter@v2 | ||||
id: changes | ||||
with: | ||||
filters: | | ||||
src: | ||||
- 'src/**' | ||||
- name: Publish package to PyPI (non-linux) | - name: Publish package to PyPI (non-linux) | |||
if: ${{ matrix.os != 'ubuntu-latest' }} | if: ${{ (matrix.os != 'ubuntu-latest') && (steps.changes.outputs.src == ' true') && (github.event_name != 'pull_request') }} | |||
env: | env: | |||
TWINE_USERNAME: __token__ | TWINE_USERNAME: __token__ | |||
TWINE_PASSWORD: ${{ secrets.PYPI }} | TWINE_PASSWORD: ${{ secrets.PYPI }} | |||
run: | | run: | | |||
python -m pip install twine | python -m pip install twine | |||
ls -R . | ls -R . | |||
twine upload src/pymod/dist/* | twine upload src/pymod/dist/* | |||
build-linux-wheels: | build-linux-wheels: | |||
runs-on: 'ubuntu-latest' | runs-on: 'ubuntu-latest' | |||
steps: | steps: | |||
- uses: actions/checkout@v2 | - uses: actions/checkout@v2 | |||
if: ${{ !contains(github.event_name, 'workflow_dispatch') }} | ||||
with: | with: | |||
fetch-depth: 0 | fetch-depth: 0 | |||
- name: Check out code for workflow_dispatch | ||||
if: ${{ contains(github.event_name, 'workflow_dispatch') }} | ||||
uses: actions/checkout@v2 | ||||
with: | ||||
fetch-depth: 0 | ||||
ref: ${{ github.event.inputs.tag }} | ||||
- name: Set env | - name: Set env | |||
run: echo "PACPARSER_VERSION=$(git describe --always --tags --candidate=10 0)" >> $GITHUB_ENV | run: echo "PACPARSER_VERSION=$(git describe --always --tags --candidate=10 0)" >> $GITHUB_ENV | |||
- name: Set up Python | - name: Set up Python | |||
uses: actions/setup-python@v3 | uses: actions/setup-python@v3 | |||
- name: make | - name: make | |||
run: make -C src pymod | run: make -C src pymod | |||
- name: Build sdist | - name: Build sdist | |||
skipping to change at line 127 | skipping to change at line 163 | |||
run: python -m pip install cibuildwheel twine | run: python -m pip install cibuildwheel twine | |||
- name: Build wheel using cibuildwheel | - name: Build wheel using cibuildwheel | |||
run: | | run: | | |||
cp src/spidermonkey/libjs.a src/pacparser.o src/pacparser.h src/pymod | cp src/spidermonkey/libjs.a src/pacparser.o src/pacparser.h src/pymod | |||
cd src/pymod && python -m cibuildwheel --output-dir dist | cd src/pymod && python -m cibuildwheel --output-dir dist | |||
env: | env: | |||
CIBW_BUILD: "cp{37,38,39,310}-manylinux*64" | CIBW_BUILD: "cp{37,38,39,310}-manylinux*64" | |||
CIBW_ENVIRONMENT: "PACPARSER_VERSION=${{ env.PACPARSER_VERSION }}" | CIBW_ENVIRONMENT: "PACPARSER_VERSION=${{ env.PACPARSER_VERSION }}" | |||
- uses: dorny/paths-filter@v2 | ||||
id: changes | ||||
with: | ||||
filters: | | ||||
src: | ||||
- 'src/**' | ||||
- name: Publish package to PyPI | - name: Publish package to PyPI | |||
if: ${{ steps.changes.outputs.src == 'true' && (github.event_name != 'pul l_request') }} | ||||
env: | env: | |||
TWINE_USERNAME: __token__ | TWINE_USERNAME: __token__ | |||
TWINE_PASSWORD: ${{ secrets.PYPI }} | TWINE_PASSWORD: ${{ secrets.PYPI }} | |||
run: | | run: | | |||
twine upload src/pymod/dist/* | twine upload src/pymod/dist/* | |||
End of changes. 11 change blocks. | ||||
1 lines changed or deleted | 45 lines changed or added |