fix: clean up after the dang LLM #12250
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: | |
| branches: | |
| - "**" | |
| tags: | |
| - "v20*" | |
| pull_request: | |
| jobs: | |
| build-conda-package: | |
| name: Build Conda Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up pixi | |
| uses: prefix-dev/[email protected] | |
| with: | |
| cache: true | |
| - name: Build conda package with pixi | |
| run: pixi build --output-dir dist | |
| - name: Upload conda package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pudl-conda-package | |
| path: dist/*.conda | |
| create-github-release: | |
| name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v20') | |
| needs: build-conda-package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download conda package artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pudl-conda-package | |
| path: dist | |
| - name: Determine previous release tag | |
| run: | | |
| echo "PREVIOUS_RELEASE_TAG=$(git tag --list 'v20*' --sort=-v:refname | grep -v "$(git describe --tags --exact-match HEAD 2>/dev/null || echo 'none')" | head -n 1)" >> "${GITHUB_ENV}" | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create '${{ github.ref_name }}' \ | |
| --title 'PUDL ${{ github.ref_name }}' \ | |
| --generate-notes \ | |
| --notes-start-tag "$PREVIOUS_RELEASE_TAG" \ | |
| --notes "PUDL is an application that must be installed from the repository using pixi. | |
| ## Installation: | |
| \`\`\`bash | |
| git clone https://github.com/catalyst-cooperative/pudl.git | |
| cd pudl | |
| git checkout ${{ github.ref_name }} | |
| pixi install | |
| \`\`\` | |
| ## Data Release: | |
| Data products generated by this release will be published separately to Zenodo | |
| as well as s3://pudl.catalyst.coop/'${{ github.ref_name }}'. | |
| ## Changes: | |
| See [Release Notes](https://catalystcoop-pudl.readthedocs.io/en/latest/release_notes.html) for details." \ | |
| --repo '${{ github.repository }}' | |
| - name: Attach conda package to GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: | | |
| for file in dist/*.conda; do | |
| gh release upload '${{ github.ref_name }}' "$file" --repo '${{ github.repository }}' --clobber | |
| done | |
| notify-slack: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - create-github-release | |
| steps: | |
| - name: Inform the Codemonkeys | |
| uses: slackapi/slack-github-action@v2 | |
| continue-on-error: true | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.PUDL_DEPLOY_SLACK_TOKEN }} | |
| payload: | | |
| { | |
| "text": "${{ needs.create-github-release.result == 'success' && ':white_check_mark:' || ':x:' }} ${{ github.repository }} release (`${{ github.ref_name }}`) finished with status: ${{ needs.create-github-release.result }}. Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | |
| "channel": "C03FHB9N0PQ" | |
| } |