Skip to content

Commit

Permalink
feat: PYPI Token / linux/mac/win
Browse files Browse the repository at this point in the history
  • Loading branch information
dirvine committed Oct 30, 2024
1 parent 8a622a3 commit 221234f
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 24 deletions.
131 changes: 109 additions & 22 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,115 @@
name: Upload Python Package
name: Build and Publish Python Package

on:
release:
types: [created]
push:
tags:
- 'v*'

jobs:
deploy:
macos:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl
if-no-files-found: error

windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
target: [x64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl
if-no-files-found: error

linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
target: [x86_64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl
if-no-files-found: error

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.tar.gz
if-no-files-found: error

release:
name: Release
runs-on: ubuntu-latest
needs: [macos, windows, linux, sdist]
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build maturin twine
- name: Build and publish
env:
MATURIN_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
maturin build --release
maturin upload --skip-existing --password $MATURIN_PASSWORD
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Display structure of downloaded files
run: ls -R dist
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
command: upload
args: --skip-existing dist/*
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "GPL-3.0"
name = "self_encryption"
readme = "README.md"
repository = "https://github.com/maidsafe/self_encryption"
version = "0.30.23"
version = "0.30.24"

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "self_encryption"
version = "0.30.23"
version = "0.30.24"
description = "Python bindings for self-encryption library"
authors = [{name = "David Irvine", email = "[email protected]"}]
requires-python = ">=3.7"
Expand Down

0 comments on commit 221234f

Please sign in to comment.