Use new rydstate package #129
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: Generate Databases | |
| on: | |
| push: | |
| branches: ["main"] | |
| tags: ["v*.*"] | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| jobs: | |
| run-generate-database: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| species: [Sr87_mqdt, Sr88_mqdt, Yb171_mqdt, Yb173_mqdt, Yb174_mqdt] | |
| include: | |
| - extra_args: "--max-delta-nu 10 --all-nu-up-to 30" | |
| # use nu-max=220 for tags and main, but only nu-max=100 for PRs, etc. | |
| - arg_max: ${{ (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') && '--nu-max 220' || '--nu-max 100' }} | |
| name: ${{ matrix.species }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 300 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: 'true' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Run generate_database.py | |
| run: uv run generate_database ${{ matrix.species }} --directory database/${{ matrix.species }}_v$(uv version --short) ${{ matrix.arg_max }} ${{ matrix.extra_args }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: database-${{ matrix.species }} | |
| path: | | |
| database/*/*.parquet | |
| github-release: | |
| name: Release database files to github releases | |
| if: startsWith(github.ref, 'refs/tags/') # only release to github on tag pushes | |
| needs: [run-generate-database] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all the database files | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: database | |
| pattern: database-* | |
| merge-multiple: true | |
| - name: Zip database folders | |
| working-directory: database/ | |
| run: | | |
| VERSION_TAG=${GITHUB_REF#refs/tags/} | |
| for dir in */; do | |
| if [[ "$dir" != *"$VERSION_TAG/" ]]; then | |
| echo "Error: Version mismatch between folder $dir and version tag $VERSION_TAG" | |
| exit 1 | |
| fi | |
| zip -r "${dir%/}.zip" "$dir" | |
| done | |
| - name: Release zipped database folders | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: database/*.zip | |
| draft: true |