-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
49 lines (45 loc) · 1.55 KB
/
azure-pipelines.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
39
40
41
42
43
44
45
46
47
48
49
variables:
majorVersion: '0.1.0'
minorVersion: $[counter('minorVersion', 1)]
version: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(version)'
imageName: 'servarr/servarrapi.auth'
sentryOrg: 'servarr'
sentryUrl: 'https://sentry.servarr.com'
trigger:
branches:
include:
- master
pr:
- master
pool:
vmImage: 'Ubuntu-22.04'
steps:
- powershell: Write-Host "##vso[build.updatebuildnumber]$($env:VERSION)"
displayName: Set Build Name
- bash: |
sed -i'' -e "s/<AssemblyVersion>[0-9.*]\+<\/AssemblyVersion>/<AssemblyVersion>$VERSION<\/AssemblyVersion>/g" src/Directory.Build.props
sed -i'' -e "s/<AssemblyConfiguration>[\$()A-Za-z-]\+<\/AssemblyConfiguration>/<AssemblyConfiguration>${BUILD_SOURCEBRANCHNAME}<\/AssemblyConfiguration>/g" src/Directory.Build.props
- task: Docker@2
displayName: Build image
inputs:
containerRegistry: 'ghcr'
repository: $(imageName)
command: buildAndPush
Dockerfile: Dockerfile
tags: |
latest
$(Build.SourceBranchName)
$(Build.BuildNumber)
- bash: |
echo "Creating sentry release"
curl -sL https://sentry.io/get-cli/ | bash
sentry-cli releases new --finalize -p servarr-auth "${VERSION}"
sentry-cli releases set-commits --auto "${VERSION}"
sentry-cli releases deploys "${VERSION}" new -e production
displayName: Create sentry release
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
env:
SENTRY_AUTH_TOKEN: $(sentryAuthTokenServarr)
SENTRY_ORG: $(sentryOrg)
SENTRY_URL: $(sentryUrl)