diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index b8feb21..affced1 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -6,38 +6,6 @@ on: - '*' jobs: - sdist: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - env: - RUST_TOOLCHAIN: "1.72" # MSRV - steps: - - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_TOOLCHAIN -y - - run: rustup default $RUST_TOOLCHAIN - - - uses: actions/checkout@v4 - - - run: python3 -m pip install --user --upgrade pip "maturin>=1,<2" wheel - - - run: maturin build - - run: cargo fetch - - run: mkdir .cargo - - - run: maturin sdist --out=dist - - - run: python3 -m pip install --user dist/rust_x3dh*.tar.gz - env: - CARGO_NET_OFFLINE: "true" - - - name: Store sdist - if: "startsWith(github.ref, 'refs/tags/')" - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist - retention-days: 1 - musllinux_1_2: runs-on: ubuntu-22.04 strategy: @@ -98,24 +66,24 @@ jobs: contents: write runs-on: ubuntu-22.04 if: "startsWith(github.ref, 'refs/tags/')" - needs: [musllinux_1_2, sdist] + needs: [musllinux_1_2] steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 + - uses: actions/download-artifact@v3 + with: + name: wheels + - uses: actions/setup-python@v2 with: python-version: "3.9" - - - name: Install dependencies - run: python -m pip install --upgrade pip setuptools wheel twine - - - name: Build package - run: python setup.py sdist bdist_wheel - - - name: Publish to PyPI + - run: pip install "maturin>=1,<2" + - run: maturin publish --skip-existing --username "${{ secrets.PYPI_USER_NAME }}" wheel + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + - run: maturin publish --skip-existing --username "${{ secrets.PYPI_USER_NAME }}" --target python${{ matrix.python.version }} + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + - run: maturin upload --skip-existing --username "${{ secrets.PYPI_USER_NAME }}" wheel + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + - run: maturin upload --skip-existing --username "${{ secrets.PYPI_USER_NAME }}" --target python${{ matrix.python.version }} env: - TWINE_USERNAME: ${{ secrets.PYPI_USER_NAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: twine upload --skip-existing dist/* + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}