Manual releases currently assume the tag already exists. This updates the workflow so workflow_dispatch can release a new version without pre-creating/pushing a tag from a local machine.
-
Tag resolution now separates release tag from checkout ref
resolve-tag now outputs:
tag (requested/release tag name)
checkout_ref (what build/test jobs should check out)
target_commitish (commit the release tag should point to)
-
Missing-tag dispatch flow
- If the tag exists: build/test/release continue on that tag.
- If the tag is missing on
workflow_dispatch: build/test run from github.sha, and release creation is instructed to create the tag at that commit.
-
Release creation owns tag creation
- Removed manual
git tag / git push behavior.
softprops/action-gh-release now receives target_commitish, allowing GitHub Release creation to create the tag when absent.
- name:Create releaseuses:softprops/action-gh-release@v2with:tag_name:${{ needs.resolve-tag.outputs.tag }}target_commitish:${{ needs.resolve-tag.outputs.target_commitish }}files:dist/*
💡 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 in the docs.
Manual releases currently assume the tag already exists. This updates the workflow so `workflow_dispatch` can release a new version without pre-creating/pushing a tag from a local machine.
- **Tag resolution now separates release tag from checkout ref**
- `resolve-tag` now outputs:
- `tag` (requested/release tag name)
- `checkout_ref` (what build/test jobs should check out)
- `target_commitish` (commit the release tag should point to)
- **Missing-tag dispatch flow**
- If the tag exists: build/test/release continue on that tag.
- If the tag is missing on `workflow_dispatch`: build/test run from `github.sha`, and release creation is instructed to create the tag at that commit.
- **Release creation owns tag creation**
- Removed manual `git tag` / `git push` behavior.
- `softprops/action-gh-release` now receives `target_commitish`, allowing GitHub Release creation to create the tag when absent.
```yaml
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.resolve-tag.outputs.tag }}
target_commitish: ${{ needs.resolve-tag.outputs.target_commitish }}
files: dist/*
```
<!-- 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.