|
|
|
@@ -11,9 +11,28 @@ on: |
|
|
|
types: [published] |
|
|
|
|
|
|
|
jobs: |
|
|
|
ci: |
|
|
|
find-jobs: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
name: Find Jobs |
|
|
|
outputs: |
|
|
|
folders: ${{ steps.jobs.outputs.folders }} |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v1 |
|
|
|
|
|
|
|
- id: jobs |
|
|
|
uses: kmanimaran/list-folder-action@v4 |
|
|
|
with: |
|
|
|
path: ./node-hub |
|
|
|
|
|
|
|
ci: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
needs: [find-jobs] |
|
|
|
defaults: |
|
|
|
run: |
|
|
|
working-directory: node-hub/${{ matrix.folder }} |
|
|
|
strategy: |
|
|
|
matrix: |
|
|
|
folder: ${{ fromJson(needs.find-jobs.outputs.folders )}} |
|
|
|
steps: |
|
|
|
- name: Checkout repository |
|
|
|
uses: actions/checkout@v2 |
|
|
|
@@ -53,11 +72,17 @@ jobs: |
|
|
|
|
|
|
|
- name: Run Linting and Tests |
|
|
|
run: | |
|
|
|
chmod +x .github/workflows/node_hub_test.sh |
|
|
|
.github/workflows/node_hub_test.sh |
|
|
|
chmod +x ../../.github/workflows/node_hub_test.sh |
|
|
|
../../.github/workflows/node_hub_test.sh |
|
|
|
|
|
|
|
publish: |
|
|
|
needs: [ci] |
|
|
|
needs: [ci, find-jobs] |
|
|
|
defaults: |
|
|
|
run: |
|
|
|
working-directory: ${{ matrix.folder }} |
|
|
|
strategy: |
|
|
|
matrix: |
|
|
|
folder: ${{ fromJson(needs.find-jobs.outputs.folders )}} |
|
|
|
runs-on: ubuntu-latest |
|
|
|
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') |
|
|
|
|
|
|
|
@@ -102,21 +127,20 @@ jobs: |
|
|
|
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_PASS }} |
|
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
|
|
|
run: | |
|
|
|
for dir in node-hub/*/ ; do |
|
|
|
if [ -d "$dir" ]; then |
|
|
|
if [[ -f "$dir/Cargo.toml" && -f "$dir/pyproject.toml" ]]; then |
|
|
|
echo "Publishing $dir using maturin..." |
|
|
|
(cd "$dir" && poetry publish) |
|
|
|
else |
|
|
|
if [ -f "$dir/pyproject.toml" ]; then |
|
|
|
echo "Publishing $dir using Poetry..." |
|
|
|
(cd "$dir" && poetry publish --build) |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
if [ -f "$dir/Cargo.toml" ]; then |
|
|
|
echo "Publishing $dir using Cargo..." |
|
|
|
(cd "$dir" && cargo publish) |
|
|
|
fi |
|
|
|
dir=$(pwd) |
|
|
|
base_dir=$(basename "$dir") |
|
|
|
|
|
|
|
if [[ -f "Cargo.toml" && -f "pyproject.toml" ]]; then |
|
|
|
echo "Publishing $dir using maturin..." |
|
|
|
poetry publish |
|
|
|
else |
|
|
|
if [ -f "pyproject.toml" ]; then |
|
|
|
echo "Publishing $dir using Poetry..." |
|
|
|
poetry publish --build |
|
|
|
fi |
|
|
|
done |
|
|
|
fi |
|
|
|
|
|
|
|
if [ -f "Cargo.toml" ]; then |
|
|
|
echo "Publishing $dir using Cargo..." |
|
|
|
cargo publish |
|
|
|
fi |