.github/workflows/publish_pypi.yml #16
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
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to publish' | |
required: true | |
jobs: | |
build-macos: | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: brew install meson | |
- name: Fetch Redex | |
run: git clone https://github.com/facebook/redex.git | |
- name: Build static binary | |
run: ./scripts/build_static_binary.py --jobs=$(sysctl -n hw.ncpu) | |
- name: Build pypi package | |
run: | | |
./scripts/setup.py \ | |
--version "${{ github.event.inputs.version }}" \ | |
--binary mariana-trench-binary \ | |
--pyredex redex/pyredex \ | |
build | |
- name: Log the output directory | |
run: ls -lisah dist | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: macos-wheels | |
path: dist/ | |
if-no-files-found: error | |
build-ubuntu: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: sudo apt-get install meson | |
- name: Fetch Redex | |
run: git clone https://github.com/facebook/redex.git | |
- name: Build static binary | |
run: ./scripts/build_static_binary.py --jobs=$(nproc) | |
- name: Build pypi package | |
run: | | |
./scripts/setup.py \ | |
--version "${{ github.event.inputs.version }}" \ | |
--binary mariana-trench-binary \ | |
--pyredex redex/pyredex \ | |
build | |
- name: Log the output directory | |
run: ls -lisah dist | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ubuntu-wheels | |
path: dist/ | |
if-no-files-found: error | |
publish-pypi: | |
runs-on: ubuntu-20.04 | |
needs: [build-macos, build-ubuntu] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Make a 'dist' folder | |
run: mkdir dist | |
- uses: actions/download-artifact@v2 | |
with: | |
name: macos-wheels | |
path: ./dist | |
- uses: actions/download-artifact@v2 | |
with: | |
name: ubuntu-wheels | |
path: ./dist | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |