Skip to content

Commit

Permalink
CI: edit Github release
Browse files Browse the repository at this point in the history
- change the name of the release
- add prepare_assets.sh script that will copy or archive the artifacts
  for release, depending on each build.
- archive_artifacts.sh will be removed because that functions will be
  included in prepare_assets.sh.

Signed-off-by: Raluca Chis <raluca.chis@analog.com>
  • Loading branch information
Raluca Chis authored and pcercuei committed Sep 7, 2021
1 parent 1c31e8b commit acd93b9
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 41 deletions.
36 changes: 0 additions & 36 deletions CI/travis/archive_artifacts.sh

This file was deleted.

46 changes: 46 additions & 0 deletions CI/travis/prepare_assets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash -e

move_artifacts() {
local rpm_assets='CentOS-7-x86_64 CentOS-8-x86_64'
cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
for i in $rpm_assets; do
cd "${i}"
find . -name '*.rpm' -exec mv {} ../ ";"
cd ../
rm -r "${i}"
done

local deb_assets='Ubuntu-16.04-x86_64 Ubuntu-18.04-x86_64
Ubuntu-20.04-x86_64 Debian-Buster-ARM
Debian-Buster-ARM64'
cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
for i in $deb_assets; do
cd "${i}"
find . -name '*.deb' -exec mv {} ../ ";"
cd ../
rm -r "${i}"
done

local pkg_assets='macOS-10.14 macOS-10.15'
cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
for i in $pkg_assets; do
cd "${i}"
find . -name '*.pkg' -exec mv {} ../ ";"
find . -name '*.gz' -exec mv {} ../ ";"
cd ../
rm -r "${i}"
done
}

archive_windows() {
local windows_dist='Win32 x64'

cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
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
}

move_artifacts
archive_windows
8 changes: 3 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,8 @@ stages:
- task: DownloadPipelineArtifact@2
inputs:
path: '$(Build.ArtifactStagingDirectory)'
- bash: ./CI/travis/archive_artifacts.sh
env:
SOURCE_DIRECTORY: $(Build.ArtifactStagingDirectory)
displayName: "Archive artifacts"
- bash: ./CI/travis/prepare_assets.sh
displayName: "Prepare assets for release"
- task: GithubRelease@0
displayName: 'Attach artifacts to GitHub Release'
inputs:
Expand All @@ -233,7 +231,7 @@ stages:
action: create
target: $(Build.SourceVersion)
tag: $(Build.SourceBranchName)
title: "$(Build.SourceBranchName): Version <edit>"
title: "Libiio release $(Build.SourceBranchName)"
assets: $(Build.ArtifactStagingDirectory)/*
addChangeLog: true
isDraft: true

0 comments on commit acd93b9

Please sign in to comment.