forked from vojtechhabarta/typescript-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
38 lines (37 loc) · 1.81 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
version: 2.36.{build}
pull_requests:
do_not_increment_build_number: true
skip_tags: true
install:
- ps: |-
git remote set-url origin https://github.com/vojtechhabarta/typescript-generator.git
git config --global credential.helper store
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):[email protected]`n"
build_script:
- ps: |-
Write-Host -ForegroundColor Cyan "Building version: $($env:APPVEYOR_BUILD_VERSION)"
$env:JAVA_HOME = "C:\Program Files\Java\jdk1.8.0"
$env:PATH = "$env:JAVA_HOME\bin;$env:PATH"
mvn -version
mvn --batch-mode versions:set "-DnewVersion=$($env:APPVEYOR_BUILD_VERSION)"; if ($LASTEXITCODE -ne 0) { throw "Build failed" }
mvn --batch-mode -P attach-artifacts clean install -P local-deploy; if ($LASTEXITCODE -ne 0) { throw "Build failed" }
if ($env:APPVEYOR_REPO_BRANCH -eq "main" -and -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
{
mvn --batch-mode site-deploy "-Dgithub.site.oauth2Token=$($env:access_token)"; if ($LASTEXITCODE -ne 0) { throw "Build failed" }
}
Write-Host -ForegroundColor Cyan "Archiving artifacts"
del target\artifacts -Recurse -Include "maven-metadata.xml*"
cd target\artifacts
7z a ..\artifacts.zip **
cd ..\..
artifacts:
- path: target\artifacts.zip
on_success:
- ps: |-
if ($env:APPVEYOR_REPO_BRANCH -eq "main" -and -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
{
Write-Host -ForegroundColor Cyan "Tagging version v$($env:APPVEYOR_BUILD_VERSION)"
git tag "v$($env:APPVEYOR_BUILD_VERSION)" $env:APPVEYOR_REPO_COMMIT
Write-Host -ForegroundColor Cyan "Pushing tag"
git push origin "v$($env:APPVEYOR_BUILD_VERSION)" 2>&1 | %{ "$_" }; if ($LASTEXITCODE -ne 0) { throw "Command returned exit code $LASTEXITCODE" } else { Write-Host "Command finished successfully" }
}