Skip to content

Multi-Platform Build and Publish #10

Multi-Platform Build and Publish

Multi-Platform Build and Publish #10

Workflow file for this run

name: Multi-Platform Build and Publish
on:
release:
types: [published]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
output: flomo/session_id.so
compile_command: gcc -fPIC -shared -o
- os: macos-latest
output: flomo/session_id.dylib
compile_command: clang -fPIC -shared -o
- os: windows-latest
output: flomo/session_id.dll
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.12.3"
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
if: runner.os == 'Linux'
- name: Set up MSVC
uses: microsoft/[email protected]
if: runner.os == 'Windows'
- name: Compile (Unix)
if: runner.os != 'Windows'
run: ${{ matrix.compile_command }} ${{ matrix.output }} flomo/session_id.c
- name: Compile (Windows)
if: runner.os == 'Windows'
run: cl.exe /LD /Fe${{ matrix.output }} flomo/session_id.c
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-library
path: ${{ matrix.output }}
publish:

Check failure on line 54 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / Multi-Platform Build and Publish

Invalid workflow file

The workflow is not valid. .github/workflows/publish.yml (Line: 54, Col: 9): Unexpected value 'publish'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.12.3"
- name: Download all artifacts
uses: actions/download-artifact@v2
with:
path: ./artifacts
- name: Move artifacts to correct locations
run: |
mkdir -p flomo
mv artifacts/Linux-library/session_id.so flomo/
mv artifacts/macOS-library/session_id.dylib flomo/
mv artifacts/Windows-library/session_id.dll flomo/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and Publish
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*