forked from 3DStris/3DStris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
62 lines (56 loc) · 2.19 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
50
51
52
53
54
55
56
57
58
59
60
61
62
trigger:
branches:
include:
- "*"
tags:
include:
- v*
paths:
exclude:
- README.adoc
- data/screenshots/*
- LICENSE
jobs:
- job: Linux
pool:
vmImage: ubuntu-latest
variables:
build_type: Release
CCACHE_DIR: $(Pipeline.Workspace)/ccache
steps:
- checkout: self
submodules: true
- bash: |
sudo apt install ninja-build -y
displayName: Install ninja
- bash: $(System.DefaultWorkingDirectory)/.azure/install-devkitarm.sh
displayName: Install devkitARM
- bash: $(System.DefaultWorkingDirectory)/.azure/install-makerom.sh
displayName: Install makerom
- bash: $(System.DefaultWorkingDirectory)/.azure/install-bannertool.sh
displayName: Install bannertool
- bash: |
source /etc/profile.d/devkit-env.sh
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -GNinja ..
ninja
displayName: Build
- bash: |
export RELEASE_TAG=$(grep -Po "(\d+\.)+\d+" $SYSTEM_DEFAULTWORKINGDIRECTORY/include/3dstris/version.hpp)-$(git rev-parse --short $BUILD_SOURCEVERSION)
echo "##vso[task.setvariable variable=release_tag]$RELEASE_TAG"
mv $SYSTEM_DEFAULTWORKINGDIRECTORY/build/bin/3dstris.3dsx $BUILD_ARTIFACTSTAGINGDIRECTORY/3dstris-$RELEASE_TAG.3dsx
mv $SYSTEM_DEFAULTWORKINGDIRECTORY/build/bin/3dstris.cia $BUILD_ARTIFACTSTAGINGDIRECTORY/3dstris-$RELEASE_TAG.cia
mv $SYSTEM_DEFAULTWORKINGDIRECTORY/build/bin/3dstris $BUILD_ARTIFACTSTAGINGDIRECTORY/3dstris-$RELEASE_TAG.elf
displayName: Rename and move binaries to artifact directory
- task: GitHubRelease@1
condition: startswith(variables['Build.SourceBranch'], 'refs/tags/')
displayName: Create GitHub release
inputs:
gitHubConnection: 3dstris-binaries
title: $(release_tag)
tagPattern: ^v(\d+\.)+(\d+\.)+(\*|\d+)$
- task: PublishBuildArtifacts@1
displayName: Upload binaries to artifacts
inputs:
artifactName: 3dstris
pathToPublish: $(Build.ArtifactStagingDirectory)