@@ -27,32 +27,58 @@ jobs:
2727 git fetch --prune --unshallow
2828 git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2929
30- - name : Extract version from tag name
31- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
30+ - name : Extract version from tag name (Unix)
31+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && runner.os != 'Windows'
3232 run : |
3333 TAG_NAME="${GITHUB_REF/refs\/tags\//}"
3434 VERSION=${TAG_NAME#v}
3535
3636 echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
3737
38- - name : Extract version from branch name (for release branches)
39- if : github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/')
38+ - name : Extract version from branch name (for release branches) (Unix)
39+ if : github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && runner.os != 'Windows'
4040 run : |
4141 BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
4242 VERSION=${BRANCH_NAME#release/}
4343
4444 echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
45+ git tag v${RELEASE_VERSION} master
4546
46- - name : Extract version from branch name (for hotfix branches)
47- if : github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/')
47+ - name : Extract version from branch name (for hotfix branches) (Unix)
48+ if : github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') && runner.os != 'Windows'
4849 run : |
4950 BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
5051 VERSION=${BRANCH_NAME#hotfix/}
5152
5253 echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
54+ git tag v${RELEASE_VERSION} master
55+
56+
57+ - name : Extract version from tag name (Windows)
58+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows'
59+ run : |
60+ $TAG_NAME = $GITHUB_REF -replace "refs/tags/",""
61+ $VERSION = $TAG_NAME -replace "v",""
62+
63+ Write-Output "RELEASE_VERSION=$VERSION"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
64+
65+ - name : Extract version from branch name (for release branches) (Windows)
66+ if : github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && runner.os == 'Windows'
67+ run : |
68+ $BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
69+ $VERSION = $BRANCH_NAME -replace "release/",""
70+
71+ Write-Output "RELEASE_VERSION=$VERSION"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
72+ git tag v${RELEASE_VERSION} master
73+
74+ - name : Extract version from branch name (for hotfix branches) (Unix)
75+ if : github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') && runner.os == 'Windows'
76+ run : |
77+ $BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
78+ $VERSION = $BRANCH_NAME -replace hotfix/",""
5379
54- - name : Set tag for setuptools-scm
55- run : git tag v${RELEASE_VERSION} master
80+ Write-Output "RELEASE_VERSION=$VERSION"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
81+ git tag v${RELEASE_VERSION} master
5682
5783 - name : Build wheels
5884 uses : joerick/cibuildwheel@v1.11.1
0 commit comments