Merge pull request #621 from scipp/default-bifrost-detector-names #20
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "*/[0-9]*" | |
| env: | |
| PIXI_FROZEN: true | |
| PIXI_NO_INSTALL: true | |
| jobs: | |
| determine-package: | |
| name: Determine package | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| package: ${{ steps.parse.outputs.package }} | |
| version: ${{ steps.parse.outputs.version }} | |
| steps: | |
| - id: parse | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| PACKAGE="${TAG%%/*}" | |
| VERSION="${TAG#*/}" | |
| echo "package=${PACKAGE}" >> "$GITHUB_OUTPUT" | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| build: | |
| name: Build ${{ needs.determine-package.outputs.package }} | |
| needs: determine-package | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Copy LICENSE into package | |
| run: cp LICENSE packages/${{ needs.determine-package.outputs.package }}/LICENSE | |
| - name: Build package | |
| run: pip install build && python -m build packages/${{ needs.determine-package.outputs.package }} | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: packages/${{ needs.determine-package.outputs.package }}/dist/ | |
| publish: | |
| name: Publish to PyPI | |
| needs: [ determine-package, build ] | |
| runs-on: ubuntu-24.04 | |
| environment: release | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| docs: | |
| name: Build and publish docs | |
| needs: [ determine-package, publish ] | |
| permissions: | |
| contents: write | |
| uses: ./.github/workflows/docs.yml | |
| with: | |
| package: ${{ needs.determine-package.outputs.package }} | |
| publish: true | |
| linkcheck: false | |
| assets: | |
| name: Upload docs | |
| needs: [ docs, determine-package ] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: docs-${{ needs.determine-package.outputs.package }} | |
| path: docs_html | |
| - name: Zip documentation | |
| run: | | |
| PACKAGE=${{ needs.determine-package.outputs.package }} | |
| VERSION=${{ needs.determine-package.outputs.version }} | |
| mv docs_html documentation-${PACKAGE}-${VERSION} | |
| zip -r documentation-${PACKAGE}-${VERSION}.zip documentation-${PACKAGE}-${VERSION} | |
| - name: Upload release assets | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| file: ./documentation-${{ needs.determine-package.outputs.package }}-${{ needs.determine-package.outputs.version }}.zip | |
| overwrite: false |