Skip to content

Commit

Permalink
ci: run release in a specific environment [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
anand-bala committed Oct 6, 2023
1 parent 5703da6 commit 30819b6
Showing 1 changed file with 26 additions and 49 deletions.
75 changes: 26 additions & 49 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,19 @@ jobs:
runs-on: ubuntu-latest
strategy:
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:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- 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') }}
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -46,32 +40,23 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
target: [x64]
target:
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
python-version:
- '3.10'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
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') }}
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -82,33 +67,23 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
python-version:
- '3.10'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- 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') }}
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --manifest-path pyargus/Cargo.toml
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -133,17 +108,19 @@ jobs:
test-release:
name: Release (test.pypi.org)
runs-on: ubuntu-latest
environment: "Test PyPI"
# if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
MATURIN_REPOSITORY_URL: "https://test.pypi.org"
with:
command: upload
args: --non-interactive --skip-existing *
args: --non-interactive --skip-existing dist/*

0 comments on commit 30819b6

Please sign in to comment.