23.10.3rc3 #68
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: Build | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: 🔨 Build distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: 🏗 Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: 🏗 Install build dependencies | |
run: | | |
python -m pip install wheel build --user | |
- name: 🔨 Build a binary wheel and a source tarball | |
run: | | |
python -m build --wheel | |
- name: ⬆ Upload build result | |
uses: actions/upload-artifact@v1 | |
with: | |
name: dist | |
path: dist | |
- name: ➕ Upload wheel to GH release page | |
uses: svenstaro/upload-release-action@v2 | |
if: github.event_name == 'release' && github.repository == 'Pioreactor/pioreactor' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/*.whl | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
build-deps: | |
name: 🔨 Build dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: 🏗 Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: 🏗 Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install wheel build --user | |
- name: 🔨 Build wheels for all dependencies | |
run: | | |
pip download -d wheels -r requirements/requirements_dev.txt --index-url https://piwheels.org/simple --platform linux_armv7l --platform linux_armv6l --platform manylinux_2_31_armv7l --only-binary=:all: --extra-index-url https://pypi.org/simple --python-version 39 | |
- name: Zip the wheels | |
run: | | |
cd wheels | |
zip -r ../wheels_${{ github.event.release.tag_name }}.zip . | |
- name: Upload zipped assets | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: wheels_${{ github.event.release.tag_name }}.zip | |
tag: ${{ github.ref }} | |
overwrite: true | |
upload-ui: | |
name: ⤵️ Fetch UI tarball | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup jq | |
run: sudo apt-get install -y jq | |
- name: Download UI tarball | |
run: | | |
latest_release=$(curl -s https://api.github.com/repos/pioreactor/pioreactorui/releases/latest | jq --raw-output '.tag_name') | |
wget https://github.com/pioreactor/pioreactorui/archive/refs/tags/$latest_release.tar.gz -O pioreactorui_$latest_release.tar.gz | |
- name: Upload zipped assets | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file_glob: true | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: pioreactorui_*.tar.gz | |
tag: ${{ github.ref }} | |
overwrite: true | |
zip-asset-upload: | |
name: 🤐 Zip assets | |
runs-on: ubuntu-latest | |
needs: [build, upload-ui, build-deps] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Download release assets | |
run: | | |
curl -s https://api.github.com/repos/pioreactor/pioreactor/releases/tags/${{ github.event.release.tag_name }} | jq -r '.assets[].browser_download_url' > assets.txt | |
mkdir release_assets | |
cd release_assets | |
while read -r line; do | |
echo "$line" | |
wget "$line" | |
done < ../assets.txt | |
- name: Zip the assets | |
run: | | |
cd release_assets | |
zip -r ../release_${{ github.event.release.tag_name }}.zip . | |
- name: Upload zipped assets | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: release_${{ github.event.release.tag_name }}.zip | |
tag: ${{ github.ref }} | |
overwrite: true | |
publish-on-pypi: | |
name: 📦 Publish tagged releases to PyPI | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: ⬇ Download build result | |
uses: actions/download-artifact@v1 | |
with: | |
name: dist | |
path: dist | |
- name: 📦 Publish to index | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PIOREACTOR_PYPI_API_TOKEN }} | |
notify-custopizer-build: | |
name: 📧 Notify Pioreactor/CustoPizer | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: 👀 Determine version | |
run: | | |
echo "PIOREACTOR_VERSION=$GITHUB_REF_NAME" >> $GITHUB_ENV | |
- name: 🚀 Repository Dispatch | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.REPODISPATCH_TOKEN }} | |
repository: Pioreactor/CustoPizer | |
event-type: pioreactor_release | |
client-payload: '{"version": "${{ env.PIOREACTOR_VERSION }}"}' |