@@ -6,43 +6,38 @@ $ErrorActionPreference = "Stop";
66# Remove the password after the RDP connection params are shown in the build output.
77# For passwords requirements and instructions for setting, see the appveyor docs:
88# https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
9- if ($env: APPVEYOR_RDP_PASSWORD ) {
10- $rdpScriptURL = ' https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'
11- iex ((new-object net.webclient).DownloadString($rdpScriptURL ))
12- }
139
1410$pythonVersion = (py -- version)
1511echo $pythonVersion
16- if ($env: APPVEYOR_REPO_TAG_NAME - and $env: APPVEYOR_REPO_TAG_NAME .StartsWith (" release-" )) {
12+ if ($env: GITHUB_REF_TYPE -eq " tag " - and $env: GITHUB_REF_NAME .StartsWith (" release-" )) {
1713 # Strip "release-" prefix.
18- $version = $env: APPVEYOR_REPO_TAG_NAME .Substring (8 )
19- Set-AppveyorBuildVariable " release" " 1 "
20- if ($env: APPVEYOR_REPO_TAG_NAME .Contains (" rc" ) -or $env: APPVEYOR_REPO_TAG_NAME .Contains (" beta" )) {
14+ $version = $env: GITHUB_REF_NAME .Substring (8 )
15+ echo " release=1 " | Out-File - FilePath $ Env: GITHUB_ENV - Encoding utf8 - Append
16+ if ($env: GITHUB_REF_TYPE -eq " tag " -and ( $ env: GITHUB_REF_NAME .Contains (" rc" ) -or $env: GITHUB_REF_NAME .Contains (" beta" ) )) {
2117 $versionType = " beta"
2218 } else {
2319 $versionType = " stable"
2420 }
2521} else {
26- $commitVersion = $env: APPVEYOR_REPO_COMMIT .Substring (0 , 8 )
22+ $commitVersion = $env: GITHUB_SHA .Substring (0 , 8 )
2723 if ($env: APPVEYOR_PULL_REQUEST_NUMBER ) {
2824 $version = " pr$env: APPVEYOR_PULL_REQUEST_NUMBER -$env: APPVEYOR_BUILD_NUMBER ," + $commitVersion
29- } elseif ($env: APPVEYOR_REPO_BRANCH -eq " master" ) {
30- $version = " alpha-$env: APPVEYOR_BUILD_NUMBER ," + $commitVersion
25+ } elseif ($env: GITHUB_REF_NAME -eq " master" ) {
26+ $version = " alpha-$env: GITHUB_RUN_ID ," + $commitVersion
3127 } else {
32- $version = " $env: APPVEYOR_REPO_BRANCH -$env: APPVEYOR_BUILD_NUMBER ," + $commitVersion
33- if ($env: APPVEYOR_REPO_BRANCH .StartsWith (" try-release-" )) {
34- Set-AppveyorBuildVariable " release" " 1 "
28+ $version = " $env: GITHUB_REF_NAME -$env: GITHUB_RUN_ID ," + $commitVersion
29+ if ($env: GITHUB_REF_NAME .StartsWith (" try-release-" )) {
30+ echo " release=1 " | Out-File - FilePath $ Env: GITHUB_ENV - Encoding utf8 - Append
3531 }
3632 }
3733 # The version is unique even for rebuilds, so we can use it for the AppVeyor version.
38- Update-AppveyorBuild - Version $version
39- if ($env: APPVEYOR_REPO_BRANCH -eq " master" ) {
34+ if ($env: GITHUB_REF_NAME -eq " master" ) {
4035 $versionType = " snapshot:alpha"
41- } elseif (! $env: APPVEYOR_REPO_BRANCH .StartsWith (" try-" )) {
42- $versionType = " snapshot:$env: APPVEYOR_REPO_BRANCH "
36+ } elseif (! $env: GITHUB_REF_NAME .StartsWith (" try-" )) {
37+ $versionType = " snapshot:$env: GITHUB_REF_NAME "
4338 }
4439}
45- Set-AppveyorBuildVariable " version" $version
40+ echo " version= $version " | Out-File - FilePath $ Env: GITHUB_ENV - Encoding utf8 - Append
4641if ($versionType ) {
47- Set-AppveyorBuildVariable " versionType" $versionType
42+ echo " versionType= $versionType " | Out-File - FilePath $ Env: GITHUB_ENV - Encoding utf8 - Append
4843}
0 commit comments