File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11on :
22 workflow_dispatch :
3- branches : [main]
3+ inputs :
4+ tag :
5+ description : " Tag to release (e.g. v1.7.0)"
6+ required : true
7+ type : string
48 push :
59 tags :
610 - " v*" # Push events to matching v*, i.e. v1.0, v20.15.10
2630 steps :
2731 - uses : actions/checkout@v6
2832 with :
33+ ref : ${{ inputs.tag || github.ref }}
2934 fetch-depth : 0
3035 - uses : actions/setup-python@v6
3136 with :
3944 echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
4045 - name : Check if tag version matches project version
4146 run : |
42- TAG=$(git describe HEAD --tags --abbrev=0)
47+ TAG=${{ inputs.tag || '' }}
48+ if [[ -z "$TAG" ]]; then
49+ TAG=$(git describe HEAD --tags --abbrev=0)
50+ fi
4351 echo $TAG
4452 echo $PROJECT_VERSION
4553 if [[ "$TAG" != "v$PROJECT_VERSION" ]]; then exit 1; fi
5563 env :
5664 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5765 with :
58- name : Release ${{ github.ref }}
66+ tag_name : ${{ inputs.tag || github.ref_name }}
67+ name : Release ${{ inputs.tag || github.ref_name }}
5968 draft : true
6069 generate_release_notes : true
6170 files : |
You can’t perform that action at this time.
0 commit comments