-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #403 from ProjectQ-Framework/hotfix/0.6.1
Fix publishing GitHub workflow
- Loading branch information
Showing
2 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,32 +27,58 @@ jobs: | |
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Extract version from tag name | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
- name: Extract version from tag name (Unix) | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && runner.os != 'Windows' | ||
run: | | ||
TAG_NAME="${GITHUB_REF/refs\/tags\//}" | ||
VERSION=${TAG_NAME#v} | ||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Extract version from branch name (for release branches) | ||
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') | ||
- name: Extract version from branch name (for release branches) (Unix) | ||
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && runner.os != 'Windows' | ||
run: | | ||
BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
VERSION=${BRANCH_NAME#release/} | ||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | ||
git tag v${RELEASE_VERSION} master | ||
- name: Extract version from branch name (for hotfix branches) | ||
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') | ||
- name: Extract version from branch name (for hotfix branches) (Unix) | ||
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') && runner.os != 'Windows' | ||
run: | | ||
BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
VERSION=${BRANCH_NAME#hotfix/} | ||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | ||
git tag v${RELEASE_VERSION} master | ||
- name: Extract version from tag name (Windows) | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' | ||
run: | | ||
$TAG_NAME = $GITHUB_REF -replace "refs/tags/","" | ||
$VERSION = $TAG_NAME -replace "v","" | ||
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
- name: Extract version from branch name (for release branches) (Windows) | ||
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && runner.os == 'Windows' | ||
run: | | ||
$BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
$VERSION = $BRANCH_NAME -replace "release/","" | ||
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
git tag v${RELEASE_VERSION} master | ||
- name: Extract version from branch name (for hotfix branches) (Unix) | ||
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') && runner.os == 'Windows' | ||
run: | | ||
$BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
$VERSION = $BRANCH_NAME -replace "hotfix/","" | ||
- name: Set tag for setuptools-scm | ||
run: git tag v${RELEASE_VERSION} master | ||
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
git tag v${RELEASE_VERSION} master | ||
- name: Build wheels | ||
uses: joerick/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters