Skip to content

Commit aaab22d

Browse files
RChis1pcercuei
authored andcommitted
ci: release process automatization
A job was added to create a new draft release for each new version tag. Draft release will contain: - buildartifacts - changelog - release title. CI/travis/archive_artifacts.sh script was added in order to archive buildartifacts that will be pushed as assets. Signed-off-by: Raluca Chis <[email protected]>
1 parent f109b9d commit aaab22d

File tree

2 files changed

+69
-4
lines changed

2 files changed

+69
-4
lines changed

CI/travis/archive_artifacts.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash -e
2+
3+
archive_linux() {
4+
local linux_dist='CentOS-7-x86_64 CentOS-8-x86_64 Ubuntu-16.04-x86_64
5+
Ubuntu-18.04-x86_64 Ubuntu-20.04-x86_64 Debian-Buster-ARM Debian-Buster-ARM64'
6+
7+
cd "${SOURCE_DIRECTORY}"
8+
for distribution in $linux_dist; do
9+
tar -zcvf Linux-"${distribution}".tar.gz Linux-"${distribution}"
10+
rm -r Linux-"${distribution}"
11+
done
12+
}
13+
14+
archive_macOS() {
15+
local macOS_dist='10.14 10.15'
16+
17+
cd "${SOURCE_DIRECTORY}"
18+
for distribution in $macOS_dist; do
19+
tar -zcvf macOS-"${distribution}".tar.gz macOS-"${distribution}"
20+
rm -r macOS-"${distribution}"
21+
done
22+
}
23+
24+
archive_windows() {
25+
local windows_dist='Win32 x64'
26+
27+
cd "${SOURCE_DIRECTORY}"
28+
for distribution in $windows_dist; do
29+
zip -r Windows-VS-16-2019-"${distribution}".zip Windows-VS-16-2019-"${distribution}"
30+
rm -r Windows-VS-16-2019-"${distribution}"
31+
done
32+
}
33+
34+
archive_linux
35+
archive_macOS
36+
archive_windows

azure-pipelines.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
trigger:
2-
- main
3-
- master
4-
- staging/*
5-
- 20*
2+
branches:
3+
include:
4+
- main
5+
- master
6+
- staging/*
7+
- 20*
8+
tags:
9+
include:
10+
- v*
611

712
pr:
813
- main
@@ -177,3 +182,27 @@ stages:
177182
env:
178183
MAPPED_VAR: $(SERVER_ADDRESS)
179184
displayName: "Push artifacts to SW Downloads"
185+
- job: PushToGithubRelease
186+
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
187+
pool:
188+
vmImage: 'ubuntu-latest'
189+
steps:
190+
- task: DownloadPipelineArtifact@2
191+
inputs:
192+
path: '$(Build.ArtifactStagingDirectory)'
193+
- bash: ./CI/travis/archive_artifacts.sh
194+
env:
195+
SOURCE_DIRECTORY: $(Build.ArtifactStagingDirectory)
196+
displayName: "Archive artifacts"
197+
- task: GithubRelease@0
198+
displayName: 'Attach artifacts to GitHub Release'
199+
inputs:
200+
gitHubConnection: libiio-release
201+
repositoryName: $(Build.Repository.Name)
202+
action: create
203+
target: $(Build.SourceVersion)
204+
tag: $(Build.SourceBranchName)
205+
title: "$(Build.SourceBranchName): Version <edit>"
206+
assets: $(Build.ArtifactStagingDirectory)/*
207+
addChangeLog: true
208+
isDraft: true

0 commit comments

Comments
 (0)