Implement external plot-publisher package and Update Dependencies (#62) #55
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: Pixi Packaging and Deployment | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| env: | |
| PKG_NAME: finddata | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Fetch all history for accurate versioning | |
| fetch-tags: true # Fetch tags to ensure versioning works correctly | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.1 | |
| - name: finddata version | |
| run: | | |
| pixi run finddata --version | |
| - name: Dependency check | |
| run: | | |
| pixi run audit-deps | |
| - name: Test imports | |
| run: | | |
| # Test that finddata can be imported with plot_publisher available (conda package scenario) | |
| pixi run python -c "import finddata; print('finddata imported successfully with plot_publisher')" | |
| # Test that plotting functions are available | |
| pixi run python -c "import finddata; assert hasattr(finddata, 'publish_plot'); assert hasattr(finddata, 'plot1d'); assert hasattr(finddata, 'plot_heatmap'); print('All plotting functions available')" | |
| # Test basic functionality | |
| pixi run finddata --version | |
| #- name: build pypi package | |
| # run: | | |
| # pixi run build-pypi | |
| package: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 100 | |
| fetch-tags: true | |
| ref: ${{ github.ref }} | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.1 | |
| - name: Build Conda package | |
| run: | | |
| pixi run build-conda | |
| mkdir -p /tmp/local-channel/linux-64 | |
| cp *.conda /tmp/local-channel/linux-64 | |
| - name: Verify conda package | |
| uses: neutrons/conda-verify@main | |
| with: | |
| package-name: finddata | |
| local-channel: /tmp/local-channel | |
| extra-channels: mantid-ornl neutrons/label/rc neutrons | |
| extra-commands: pixi run python -c "import finddata" | |
| - name: Upload conda package as artifact | |
| uses: actions/upload-artifact@v4 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| name: artifact-conda-package | |
| path: ${{ env.PKG_NAME }}-*.conda | |
| publish: | |
| runs-on: ubuntu-24.04 | |
| needs: [tests, package] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 100 | |
| fetch-tags: true | |
| ref: ${{ github.ref }} | |
| - name: Setup Pixi | |
| uses: prefix-dev/setup-pixi@v0.9.1 | |
| with: | |
| pixi-version: v0.49.0 | |
| - name: Download conda package artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: artifact-conda-package | |
| - name: Upload package to anaconda | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
| IS_RC: ${{ contains(github.ref, 'rc') }} | |
| run: | | |
| # label is main or rc depending on the tag-name | |
| CONDA_LABEL="main" | |
| if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi | |
| echo pushing ${{ github.ref }} with label $CONDA_LABEL | |
| pixi run anaconda upload --label $CONDA_LABEL --user neutrons ${{ env.PKG_NAME }}-*.conda |