Skip to content

Commit

Permalink
Merge pull request #3 from SubPointSolutions/dev
Browse files Browse the repository at this point in the history
Appveyor build integration
  • Loading branch information
SubPointSupport authored Feb 4, 2019
2 parents b49fc6c + b2cbd4c commit 0a9018a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,23 @@ task VersionGem {
$stamp = $stamp.Replace(".00", ".")
$stamp = $stamp.Replace(".0", ".")

$script:Version = "0.1.$stamp"
if($null -ne $env:APPVEYOR_REPO_BRANCH) {
Write-Build Green " [~] Running under APPVEYOR branch: $($env:APPVEYOR_REPO_BRANCH)"

if($env:APPVEYOR_REPO_BRANCH -ine "beta" -and $env:APPVEYOR_REPO_BRANCH -ine "master") {
Write-Build Green " skipping APPVEYOR versioning for branch: $($env:APPVEYOR_REPO_BRANCH)"
} else {
Write-Build Green " using APPVEYOR versioning for branch: $($env:APPVEYOR_REPO_BRANCH)"

## 1902.build-no
$stamp = Get-Date -f "yyMM"
$buildNumber = $env:APPVEYOR_BUILD_NUMBER;

$script:Version = "0.2.$stamp.$buildNumber"
}
} else {
$script:Version = "0.1.$stamp"
}

if ($null -ne $buildVersion ) {
Write-Build Yello " [+] Using version from params: $buildVersion"
Expand Down Expand Up @@ -126,10 +142,11 @@ task PublishGem {
$apiKeyValue = (get-item env:$apiKeyEnvName).Value;

"---" > $apiKeyFile
":rubygems_api_key: $apiKeyEnvName" >> $apiKeyFile
":rubygems_api_key: $apiKeyValue" >> $apiKeyFile
}

exec {
Write-Build Green "gem push latest.gem"
Set-Location "$buildOutput"
pwsh -c "gem push latest.gem"
}
Expand Down Expand Up @@ -195,7 +212,14 @@ task AnalyzeModule {

# Synopsis: Executes Appveyor specific setup
task AppveyorPrepare {

Write-Build Green "ruby -v"
ruby -v

Write-Build Green "gem -v"
gem -v

Write-Build Green "bundle -v"
bundle -v
}

task QA AnalyzeModule
Expand Down
7 changes: 7 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
test: off

environment:
matrix:
- RUBY_VERSION: 22

install:
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%

build_script:
- ps: pwsh -c Install-Module -Name InvokeBuild -Force
- ps: pwsh -c invoke-build Appveyor
Expand Down

0 comments on commit 0a9018a

Please sign in to comment.