Skip to content

Commit

Permalink
[WIP] Merge python workflow in other workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr committed Oct 8, 2024
1 parent 9e43013 commit a0b8337
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 141 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/check_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,71 @@ jobs:
${{ env.ASSET }}
compression-level: 0

python:
name: Python wrapping
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install -y libfuse-dev
- name: Install dependencies
if: ${{ matrix.os == 'macos-latest'}}
run: |
brew install macfuse
- name: Checkout code
uses: actions/checkout@v4

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --find-interpreter
sccache: 'true'
container: off
working-directory: python

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.toolchain }}
path: python/dist
compression-level: 0

python-sdist:
name: Python sdist
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
working-directory: python
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: python/dist

check-publication:
name: Check cargo publication
runs-on: ubuntu-latest
Expand All @@ -175,3 +240,17 @@ jobs:
#cargo publish --dry-run -p arx
#cargo publish --dry-run -p tar2arx
#cargo publish --dry-run -p zip2arx
python-check-publication:
name: Check pypi publication
runs-on: ubuntu-latest
needs: [python, python-sdist]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
with:
command: upload
args: --non-interactive --repository=testpypi --skip-existing wheels-*/*
68 changes: 67 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

jobs:
build_and_test:
name: Rust project - latest
name: Rust
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -64,6 +64,72 @@ jobs:
target/debug/auto_mount
compression-level: 0


python:
name: Python wrapping
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install -y libfuse-dev
- name: Install dependencies
if: ${{ matrix.os == 'macos-latest'}}
run: |
brew install macfuse
- name: Checkout code
uses: actions/checkout@v4

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --find-interpreter
sccache: 'true'
container: off
working-directory: python

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.toolchain }}
path: python/dist
compression-level: 0

python-sdist:
name: Python sdist
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
working-directory: python
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: python/dist

compilation_32bits:
name: Test 32 bits compilation
runs-on: ubuntu-latest
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,73 @@ jobs:
run: |
version="${{ needs.create-release.outputs.version }}"
gh release upload "$version" ${{ env.ASSET }} ${{ env.ASSET_SUM }}
python:
name: Python wrapping
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install -y libfuse-dev
- name: Install dependencies
if: ${{ matrix.os == 'macos-latest'}}
run: |
brew install macfuse
- name: Checkout code
uses: actions/checkout@v4

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --find-interpreter
sccache: 'true'
container: off
working-directory: python

- name: Upload wheels
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
version="${{ needs.create-release.outputs.version }}"
gh release upload "$version" ${{ env.ASSET }} ${{ env.ASSET_SUM }}
python-sdist:
name: Python sdist
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
working-directory: python
- name: Upload sdist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
version="${{ needs.create-release.outputs.version }}"
gh release upload "$version" ${{ env.ASSET }} ${{ env.ASSET_SUM }}
140 changes: 0 additions & 140 deletions .github/workflows/python.yml

This file was deleted.

Loading

0 comments on commit a0b8337

Please sign in to comment.