This repository has been archived by the owner on Feb 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
100 lines (90 loc) · 3.18 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
trigger:
branches:
include: ['*']
exclude: [translation]
tags:
include: ['*']
pr:
branches:
exclude: ['*']
name: $[format('{0:yyyyMMdd\-HHmmss}', pipeline.startTime)]
pool:
vmImage: 'Ubuntu-16.04'
variables:
- group: 'Secrets (Universal-Team webhook)'
- name: CURRENT_DATE
value: $[format('{0:yyyyMMdd\-HHmmss}', pipeline.startTime)]
- name: REPOSITORY_NAME
value: $(Build.Repository.Name)
- name: COMMIT_TAG
value: $(git log --format=%h -1)
steps:
- script: |
curl -L https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb -o pacman.deb
sudo apt update
sudo apt install p7zip-full haveged qrencode
sudo dpkg -i pacman.deb
sudo dkp-pacman -Sy
sudo dkp-pacman -S nds-dev --noconfirm
displayName: 'Setup devkitPro'
- script: |
export PATH=$PATH:$(pwd)
export DEVKITPRO="/opt/devkitpro"
export DEVKITARM="/opt/devkitpro/devkitARM"
make
cp iDex.nds $(Build.ArtifactStagingDirectory)
echo '##vso[task.setvariable variable=COMMIT_TAG]'$(git log --format=%h -1)
echo '##vso[task.setvariable variable=COMMIT_MESSAGE]'$(git log --pretty=format:"%an - %s" -1)
displayName: 'Build iDex'
- script: |
git config --global user.email "flamekat54@aol.com"
git config --global user.name "TWLBot"
git clone --depth 1 https://$GITHUB_TOKEN@github.com/Universal-Team/extras.git
mkdir extras/builds/iDex/
cd extras/builds/iDex/
cp ../../../iDex.nds iDex.nds
# qrencode -o iDex.png https://github.com/Universal-Team/raw/v$CURRENT_DATE/builds/iDex/iDex.cia
git stage .
git commit -m "iDex | $(COMMIT_TAG)"
git push origin master
git tag v$CURRENT_DATE
echo '##vso[task.setvariable variable=TWLBOT_COMMIT]'$(git log -1 --format="%H")
displayName: "Commit to Universal-Team/extras"
- task: GitHubRelease@0
displayName: "Release to Universal-Team/extras"
inputs:
gitHubConnection: TWLBot
repositoryName: Universal-Team/extras
action: create
target: $(TWLBOT_COMMIT)
tagSource: 'manual'
tag: v$(CURRENT_DATE)
title: iDex | $(COMMIT_TAG)
releaseNotesSource: input
releaseNotes: $(COMMIT_MESSAGE)
assets: '$(Build.ArtifactStagingDirectory)/*'
isPreRelease: true
addChangeLog: false
- task: GitHubRelease@0
displayName: "Release to Universal-Team/iDex"
condition: startsWith(variables['Build.SourceBranchName'], 'v')
inputs:
gitHubConnection: TWLBot
repositoryName: Universal-Team/iDex
action: edit
target: '$(Build.SourceVersion)'
tag: $(Build.SourceBranchName)
assets: '$(Build.ArtifactStagingDirectory)/**/*'
- script: |
curl -o send.sh https://raw.githubusercontent.com/Universal-Team/discord-webhooks/master/send-azure.sh
chmod +x send.sh
export IMAGE=https://raw.githubusercontent.com/Universal-Team/extras/v$CURRENT_DATE/builds/iDex/iDex.png
./send.sh success $WEBHOOK_URL
condition: succeeded()
displayName: "Send success webhook"
- script: |
curl -o send.sh https://raw.githubusercontent.com/Universal-Team/discord-webhooks/master/send-azure.sh
chmod +x send.sh
./send.sh failure $WEBHOOK_URL
condition: failed()
displayName: "Send failure webhook"