-
Notifications
You must be signed in to change notification settings - Fork 0
ci: adopt blueprint release pipeline #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
64a7448
11b04b5
820bd8c
7dda08d
95078dc
59c0f32
db60b83
d11c60f
12b3b97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,27 +1,39 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Dependabot auto-merge | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| on: pull_request | ||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| auto-merge: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Auto-merge patch | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.actor == 'dependabot[bot]' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Dependabot metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: dependabot/fetch-metadata@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| id: metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: dependabot/fetch-metadata@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Generate app token | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| id: app-token | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/create-github-app-token@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| app-id: ${{ secrets.APP_ID }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: When a GitHub Actions workflow is triggered by Dependabot on the pull_request event, only Dependabot secrets are available. Repository Actions secrets are not available. Citations:
Ensure On Dependabot-triggered Add a fast-fail check to catch missing secrets early: Recommended fail-fast guard+ - name: Verify Dependabot app secrets
+ if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
+ env:
+ APP_ID: ${{ secrets.APP_ID }}
+ APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
+ run: |
+ test -n "$APP_ID" || { echo "::error::APP_ID must be configured as a Dependabot secret"; exit 1; }
+ test -n "$APP_PRIVATE_KEY" || { echo "::error::APP_PRIVATE_KEY must be configured as a Dependabot secret"; exit 1; }
+
- name: Generate app token
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
id: app-token
uses: actions/create-github-app-token@v2📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Approve PR | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: gh pr review "$PR" --approve | ||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PR: ${{ github.event.pull_request.html_url }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Auto-merge minor and patch updates | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: >- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| steps.metadata.outputs.update-type == 'version-update:semver-patch' || | ||||||||||||||||||||||||||||||||||||||||||||||||||
| steps.metadata.outputs.update-type == 'version-update:semver-minor' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: gh pr merge --auto --squash "$PR_URL" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Enable auto-merge | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: gh pr merge "$PR" --auto --squash | ||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PR: ${{ github.event.pull_request.html_url }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ github.token }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: Publish | ||
|
|
||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
|
|
||
| concurrency: | ||
| group: publish-${{ github.ref_name }} | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| attestations: write | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Build & publish to PyPI | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 10 | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/project/fluxopt_plot | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Build | ||
| run: uv build | ||
|
|
||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
|
||
| github-release: | ||
| name: Create GitHub Release | ||
| needs: [publish] | ||
| if: github.event_name == 'push' && needs.publish.result == 'success' | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
|
|
||
| - name: Create GitHub Release | ||
| run: | | ||
| if gh release view "$TAG" &>/dev/null; then | ||
| echo "Release $TAG already exists, skipping." | ||
| exit 0 | ||
| fi | ||
| if [[ "$TAG" == *-* ]]; then | ||
| gh release create "$TAG" --generate-notes --prerelease | ||
| else | ||
| gh release create "$TAG" --generate-notes | ||
| fi | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| TAG: ${{ github.ref_name }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| version: 2 | ||
|
|
||
| mkdocs: | ||
| configuration: mkdocs.yml | ||
|
|
||
| build: | ||
| os: ubuntu-24.04 | ||
| tools: | ||
| python: "3.13" | ||
| jobs: | ||
| pre_create_environment: | ||
| - asdf plugin add uv | ||
| - asdf install uv latest | ||
| - asdf global uv latest | ||
| create_environment: | ||
| - uv venv "${READTHEDOCS_VIRTUALENV_PATH}" | ||
| install: | ||
| - UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --group docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In uv, doesuv sync --extra docsinstall packages from[dependency-groups].docs, or do dependency groups requireuv sync --group docs?💡 Result:
In uv, uv sync --extra docs does NOT install packages from [dependency-groups].docs. The --extra flag is for including optional dependencies (extras) from [project.optional-dependencies], while dependency groups from [dependency-groups] require uv sync --group docs. Dependency groups are read from the [dependency-groups] table (PEP 735). The dev group is synced by default, but other groups like docs need explicit --group docs. Options include --group, --only-group, --all-groups, --no-group, etc. --extra and --group serve distinct purposes: extras for published optional deps, groups for local dev deps.
Citations:
🏁 Script executed:
Repository: FBumann/fluxopt_plot
Length of output: 559
Use
--group docshere, not--extra docs.uv sync --extra ...reads from[project.optional-dependencies], while dependency groups are selected with--group. This repo declaresdocsunder[dependency-groups], and.readthedocs.yamlalready uses the correctuv sync --group docsform, so this command is syncing the wrong dependency set.♻️ Proposed fix
🤖 Prompt for AI Agents