Add README entry for prefix.dev #629
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build, test and publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - main | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install micromamba | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment.yml | |
| environment-name: mambajs | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Run eslint | |
| run: yarn run eslint:check | |
| unittest_and_build_wheels: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install Micromamba dev env | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment.yml | |
| environment-name: mambajs | |
| - name: Install JS dependencies | |
| run: yarn install | |
| - name: Build mambajs JS | |
| run: yarn run build | |
| - name: Run JS tests | |
| run: yarn run test | |
| - name: Install bun | |
| run: curl -fsSL https://bun.sh/install | bash | |
| - name: Build Python wheels | |
| run: python scripts/build_wheels.py | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist ${{ github.run_number }} | |
| path: ./python/dist | |
| test_wheel: | |
| runs-on: ${{ matrix.os }}-latest | |
| needs: [unittest_and_build_wheels] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu, windows, macos] | |
| include: | |
| - os: ubuntu | |
| dist: 'mambajs*linux*x86_64.whl' | |
| - os: windows | |
| dist: 'mambajs*win*.whl' | |
| - os: macos | |
| dist: 'mambajs*macos*arm64.whl' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install Micromamba dev env | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment.yml | |
| environment-name: mambajs | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: dist ${{ github.run_number }} | |
| path: ./dist | |
| - name: Install the package | |
| run: pip install -vv ${{ matrix.dist }} | |
| working-directory: dist | |
| - name: Test help | |
| run: mambajs --help | |
| - name: Run CLI test | |
| run: pytest . -vvv -s | |
| working-directory: tests | |
| publish_wheels_and_npm_packages: | |
| runs-on: ubuntu-latest | |
| needs: [test_wheel] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| if: startsWith(github.ref, 'refs/tags/') # Run only on pushed tags | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download wheels | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: dist ${{ github.run_number }} | |
| path: ./dist | |
| - name: Install Micromamba dev env | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: environment.yml | |
| environment-name: mambajs | |
| - name: Publish wheels to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| - name: Install JS dependencies | |
| run: yarn install | |
| - name: Build JS packages | |
| run: yarn run build | |
| - name: Publish all packages under packages/ to npm | |
| run: | | |
| for pkg in packages/*; do | |
| if [ -f "$pkg/package.json" ]; then | |
| echo "Publishing $pkg..." | |
| (cd "$pkg" && npm publish) | |
| fi | |
| done |