Skip to content

Commit

Permalink
Switch to Azure Pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed Jul 7, 2020
1 parent 2f68028 commit 1b420c7
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 80 deletions.
80 changes: 0 additions & 80 deletions .appveyor.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .ci/azure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Azure Pipeline YAML file

name: 1.3.0$(Rev:.r)

trigger:
branches:
include:
- master
tags:
include:
- '*'

variables:
_IS_BUILD_CANARY: false
_RELEASE_NAME: iPoPS
_RELEASE_VERSION: v0
_RELEASE_CONFIGURATION: Release
_BUILD_VERSION: $(Build.BuildNumber)
_BUILD_BRANCH: $(Build.SourceBranch)

pool:
vmImage: 'macOS-latest'

steps:
- checkout: self
- task: PowerShell@2
displayName: 'Build and Package $(_RELEASE_NAME)'
inputs:
filePath: .ci/build.ps1
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'true'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')))
displayName: 'Delete $(_RELEASE_NAME) Release (Canary)'
continueOnError: true
inputs:
gitHubConnection: github_ci
action: delete
tagSource: manual
tag: canary
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'true'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')))
displayName: 'Create $(_RELEASE_NAME) Release (Canary)'
inputs:
gitHubConnection: github_ci
assets: .dist/*.dmg
isPreRelease: true
tagSource: manual
tag: canary
title: $(_RELEASE_NAME)-$(_RELEASE_VERSION)
releaseNotesSource: input
releaseNotes: |
This is a canary build. Please be aware it may be prone to crashing and is NOT tested by anyone.
The App is NOT signed. You need to allow it to run in your Gatekeeper settings panel. Use this build AT YOUR OWN RISK!
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'false'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')))
displayName: 'Create $(_RELEASE_NAME) Release (Stable)'
inputs:
gitHubConnection: github_ci
assets: .dist/*.dmg
title: $(_RELEASE_NAME)-$(_RELEASE_VERSION)
29 changes: 29 additions & 0 deletions .ci/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$env:_APP_VERSION = $env:_BUILD_VERSION.Substring(0,$env:_BUILD_VERSION.LastIndexOf('.'))
if ($env:_BUILD_BRANCH -eq "refs/heads/master" -Or $env:_BUILD_BRANCH -eq "refs/tags/canary") {
$env:_IS_BUILD_CANARY = "true"
}
elseif ($env:_BUILD_BRANCH -like "refs/tags/*") {
$env:_BUILD_VERSION = $env:_BUILD_VERSION.Substring(0,$env:_BUILD_VERSION.LastIndexOf('.')) + ".0"
}
$env:_RELEASE_VERSION = "v${env:_BUILD_VERSION}"

Write-Output "--------------------------------------------------"
Write-Output "APP VERSION: $env:_APP_VERSION"
Write-Output "BUILD CONFIGURATION: $env:_RELEASE_CONFIGURATION"
Write-Output "RELEASE VERSION: $env:_RELEASE_VERSION"
Write-Output "--------------------------------------------------"

Write-Host "##vso[task.setvariable variable=_BUILD_VERSION;]${env:_BUILD_VERSION}"
Write-Host "##vso[task.setvariable variable=_RELEASE_VERSION;]${env:_RELEASE_VERSION}"
Write-Host "##vso[task.setvariable variable=_IS_BUILD_CANARY;]${env:_IS_BUILD_CANARY}"

agvtool new-marketing-version $env:_APP_VERSION
xcodebuild -project "${env:_RELEASE_NAME}.xcodeproj" -scheme "${env:_RELEASE_NAME}" -configuration "${env:_RELEASE_CONFIGURATION}" -derivedDataPath ".dist"

npm install --global create-dmg
Copy-Item LICENSE .dist/Build/Products/$env:_RELEASE_CONFIGURATION/license.txt

$ErrorActionPreference = 'SilentlyContinue'
create-dmg .dist/Build/Products/$env:_RELEASE_CONFIGURATION/${env:_RELEASE_NAME}.app .dist/
Move-Item ".dist/${env:_RELEASE_NAME} ${env:_APP_VERSION}.dmg" .dist/${env:_RELEASE_NAME}.dmg
exit 0

0 comments on commit 1b420c7

Please sign in to comment.