ci: run release in a specific environment [skip ci]

This commit is contained in:
Anand Balakrishnan 2023-10-06 11:27:39 -07:00
parent 5703da6ace
commit 30819b6b9c
No known key found for this signature in database

View file

@ -10,25 +10,19 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
target: [x86_64, aarch64] target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- armv7
python-version:
- '3.10'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: '3.10' python-version: ${{ matrix.python-version }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Generate lockfile
run: cargo generate-lockfile
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-py3.10-cargo-${{ hashFiles('Cargo.lock') }}
- name: Build wheels - name: Build wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
with: with:
@ -46,32 +40,23 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
strategy: strategy:
matrix: matrix:
target: [x64] target:
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
python-version:
- '3.10'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: '3.10' python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Generate lockfile
run: cargo generate-lockfile
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-py3.10-cargo-${{ hashFiles('Cargo.lock') }}
- name: Build wheels - name: Build wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
with: with:
target: ${{ matrix.target }} target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml
sccache: 'true' sccache: 'true'
manylinux: auto
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -82,33 +67,23 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
strategy: strategy:
matrix: matrix:
target: [x86_64, aarch64] target:
- x86_64-apple-darwin
- aarch64-apple-darwin
python-version:
- '3.10'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: '3.10' python-version: ${{ matrix.python-version }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}-apple-darwin
- name: Generate lockfile
run: cargo generate-lockfile
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-py3.10-cargo-${{ hashFiles('Cargo.lock') }}
- name: Build wheels - name: Build wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
with: with:
target: ${{ matrix.target }} target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml
sccache: 'true' sccache: 'true'
manylinux: auto
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -133,12 +108,14 @@ jobs:
test-release: test-release:
name: Release (test.pypi.org) name: Release (test.pypi.org)
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: "Test PyPI"
# if: "startsWith(github.ref, 'refs/tags/')" # if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist] needs: [linux, windows, macos, sdist]
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: wheels name: wheels
path: dist
- name: Publish to PyPI - name: Publish to PyPI
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
env: env:
@ -146,4 +123,4 @@ jobs:
MATURIN_REPOSITORY_URL: "https://test.pypi.org" MATURIN_REPOSITORY_URL: "https://test.pypi.org"
with: with:
command: upload command: upload
args: --non-interactive --skip-existing * args: --non-interactive --skip-existing dist/*