-
Notifications
You must be signed in to change notification settings - Fork 59
Commit 8b98b36
fix: add tags trigger to release workflow to enable tag-based releases (#544)
The release workflow was broken after #537 added `branches-ignore` to
prevent running on bot branches. While this successfully prevented
unnecessary runs on `copilot/**`, `dependabot/**`, and
`pre-commit-ci-update-config` branches, it inadvertently prevented the
workflow from running on tag pushes.
The issue occurs because GitHub Actions treats tag pushes differently
from branch pushes. When using `branches-ignore` without an explicit
`tags` section, the workflow will only trigger on branch pushes
(excluding the ignored ones) and pull requests, but not on tag pushes.
The `release.yml` workflow has a condition `if: github.event_name ==
'push' && startsWith(github.ref, 'refs/tags')` indicating it's designed
to run on tag pushes, but without the proper trigger configuration, it
never gets the chance to execute.
This fix adds an explicit `tags` trigger to the workflow:
```yaml
on:
push:
branches-ignore:
- 'copilot/**'
- 'dependabot/**'
- 'pre-commit-ci-update-config'
tags:
- 'v*'
pull_request:
```
This follows the same pattern used in:
- The deepmd-kit repository (PR #3402) which had the identical issue
- Other workflows in this repository (`ci-docker.yml` and
`publish_conda.yml`) that already correctly trigger on tags
The workflow will now run on:
- Branch pushes (excluding bot branches)
- Tag pushes matching the `v*` pattern (e.g., `v1.0.0`, `v2.1.3`)
- Pull requests
The PyPI publishing step will only execute when the workflow is
triggered by a tag push, as intended by the existing condition.
Fixes #543.
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `39.106.xx.xx`
> - Triggering command: `python -m coverage run -p
--source=./dpdispatcher -m unittest -v` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/deepmodeling/dpdispatcher/settings/copilot/coding_agent)
(admins only)
>
> </details>
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: njzjz <[email protected]>1 parent 2fc5d55 commit 8b98b36Copy full SHA for 8b98b36
File tree
Expand file treeCollapse file tree
1 file changed
+2
-0
lines changedOpen diff view settings
Filter options
- .github/workflows
Expand file treeCollapse file tree
1 file changed
+2
-0
lines changedOpen diff view settings
Collapse file
.github/workflows/release.yml
Copy file name to clipboardExpand all lines: .github/workflows/release.yml+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
0 commit comments