Skip to content

Commit d877b9d

Browse files
Python Moose-Cli (#1685)
* add needs * dry run * add workign directory * move around * attempt 3 * attempt 4 * remove sdist * cli * manylinux * try again * remove build step * output target dir
1 parent 75d9302 commit d877b9d

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

.github/workflows/release-cli.yaml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ jobs:
4747
generateReleaseNotes: true
4848
commit: ${{ github.sha }}
4949

50-
build-and-publish:
50+
build-and-publish-py-moose-lib:
5151
runs-on: ubuntu-latest
52+
if: ${{ !inputs.dry-run }}
5253
needs:
5354
- version
5455
steps:
@@ -73,6 +74,7 @@ jobs:
7374
package-and-publish-independant-ts-package:
7475
name: Package and Publish Independant TS Package
7576
runs-on: ubuntu-20.04
77+
if: ${{ !inputs.dry-run }}
7678
needs:
7779
- version
7880
permissions:
@@ -196,13 +198,19 @@ jobs:
196198
cargo set-version ${{ needs.version.outputs.version }}
197199
working-directory: ./apps/framework-cli
198200

199-
- name: Build
200-
uses: actions-rs/cargo@v1
201+
- name: Build wheels
202+
uses: PyO3/maturin-action@v1
203+
with:
204+
target: ${{ matrix.build.TARGET }}
205+
args: --release --features rdkafka/cmake-build --locked --target ${{ matrix.build.TARGET }} --out dist
206+
sccache: "true"
207+
working-directory: ./apps/framework-cli
208+
209+
- name: Upload wheels
210+
uses: actions/upload-artifact@v4
201211
with:
202-
command: build
203-
# --features rdkafka/cmake-build is necessary for cross compilation builds
204-
args: --manifest-path ./apps/framework-cli/Cargo.toml --features rdkafka/cmake-build --release --locked --target ${{ matrix.build.TARGET }}
205-
use-cross: ${{ matrix.build.OS == 'ubuntu-20.04' }} # use `cross` for Linux builds
212+
name: wheels-linux-${{ matrix.build.TARGET }}
213+
path: ./apps/framework-cli/dist
206214

207215
- name: Install node
208216
uses: actions/setup-node@v4
@@ -228,6 +236,23 @@ jobs:
228236
artifacts: |
229237
./target/${{ matrix.build.TARGET }}/release/moose-cli-${{ matrix.build.TARGET }}
230238
239+
release-python:
240+
name: Release
241+
runs-on: ubuntu-latest
242+
needs: [build-and-publish-binaries]
243+
if: ${{ !inputs.dry-run }}
244+
steps:
245+
- uses: actions/download-artifact@v4
246+
- name: Publish to PyPI
247+
uses: PyO3/maturin-action@v1
248+
env:
249+
MATURIN_PYPI_TOKEN: __token__
250+
MATURIN_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
251+
with:
252+
command: upload
253+
args: --non-interactive --skip-existing wheels-*/*
254+
working-directory: ./apps/framework-cli
255+
231256
publish-npm-base:
232257
name: Publish the base NPM package
233258
needs:

apps/framework-cli/pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[build-system]
2+
requires = ["maturin>=0.14,<0.15"]
3+
build-backend = "maturin"
4+
5+
[project]
6+
name = "moose-cli"
7+
description = "Moose CLI"
8+
requires-python = ">=3.7"
9+
10+
[tool.maturin]
11+
bindings = "bin"
12+
strip = true

0 commit comments

Comments
 (0)