Skip to content

Commit

Permalink
ci: release process automatization
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
RChis1 authored and pcercuei committed Aug 18, 2021
1 parent f109b9d commit aaab22d
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 4 deletions.
36 changes: 36 additions & 0 deletions CI/travis/archive_artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash -e

archive_linux() {
local linux_dist='CentOS-7-x86_64 CentOS-8-x86_64 Ubuntu-16.04-x86_64
Ubuntu-18.04-x86_64 Ubuntu-20.04-x86_64 Debian-Buster-ARM Debian-Buster-ARM64'

cd "${SOURCE_DIRECTORY}"
for distribution in $linux_dist; do
tar -zcvf Linux-"${distribution}".tar.gz Linux-"${distribution}"
rm -r Linux-"${distribution}"
done
}

archive_macOS() {
local macOS_dist='10.14 10.15'

cd "${SOURCE_DIRECTORY}"
for distribution in $macOS_dist; do
tar -zcvf macOS-"${distribution}".tar.gz macOS-"${distribution}"
rm -r macOS-"${distribution}"
done
}

archive_windows() {
local windows_dist='Win32 x64'

cd "${SOURCE_DIRECTORY}"
for distribution in $windows_dist; do
zip -r Windows-VS-16-2019-"${distribution}".zip Windows-VS-16-2019-"${distribution}"
rm -r Windows-VS-16-2019-"${distribution}"
done
}

archive_linux
archive_macOS
archive_windows
37 changes: 33 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
trigger:
- main
- master
- staging/*
- 20*
branches:
include:
- main
- master
- staging/*
- 20*
tags:
include:
- v*

pr:
- main
Expand Down Expand Up @@ -177,3 +182,27 @@ stages:
env:
MAPPED_VAR: $(SERVER_ADDRESS)
displayName: "Push artifacts to SW Downloads"
- job: PushToGithubRelease
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadPipelineArtifact@2
inputs:
path: '$(Build.ArtifactStagingDirectory)'
- bash: ./CI/travis/archive_artifacts.sh
env:
SOURCE_DIRECTORY: $(Build.ArtifactStagingDirectory)
displayName: "Archive artifacts"
- task: GithubRelease@0
displayName: 'Attach artifacts to GitHub Release'
inputs:
gitHubConnection: libiio-release
repositoryName: $(Build.Repository.Name)
action: create
target: $(Build.SourceVersion)
tag: $(Build.SourceBranchName)
title: "$(Build.SourceBranchName): Version <edit>"
assets: $(Build.ArtifactStagingDirectory)/*
addChangeLog: true
isDraft: true

0 comments on commit aaab22d

Please sign in to comment.