Skip to content

Commit

Permalink
CI: prepare artifacts for SWDownloads
Browse files Browse the repository at this point in the history
- on SWDownloads, artifacts will be overwritten in order
  to be available only latest from master. For this, in
  prepare_assets.sh script, function swdownloads_artifacts()
  was added to rename artifacts as ${OS}_latest_master_libiio.

Signed-off-by: Raluca Chis <[email protected]>
  • Loading branch information
Raluca Chis authored and pcercuei committed Nov 29, 2021
1 parent fbf5adb commit 504dc62
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
42 changes: 35 additions & 7 deletions CI/travis/prepare_assets.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e

move_artifacts() {
release_artifacts() {
local rpm_assets='CentOS-7-x86_64 CentOS-8-x86_64'
cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
for i in $rpm_assets; do
Expand All @@ -21,7 +21,7 @@ move_artifacts() {
rm -r "${i}"
done

local pkg_assets='macOS-10.14 macOS-10.15'
local pkg_assets='macOS-10.15 macOS-11'
cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
for i in $pkg_assets; do
cd "${i}"
Expand All @@ -30,17 +30,45 @@ move_artifacts() {
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
swdownloads_artifacts() {
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'
for distribution in $linux_dist; do
cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
cd "Linux-${distribution}"
find . -name '*.rpm' -exec mv {} ../"${distribution}"_latest_master_libiio.rpm ";"
find . -name '*.deb' -exec mv {} ../"${distribution}"_latest_master_libiio.deb ";"
rm -r ../Linux-"${distribution}"
done

local macOS_dist='macOS-10.15 macOS-11'
for distribution in $macOS_dist; do
cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
cd "${distribution}"
find . -name '*.pkg' -exec mv {} ../"${distribution}"_latest_master_libiio.pkg ";"
find . -name '*.tar.gz' -exec mv {} ../"${distribution}"_latest_master_libiio.tar.gz ";"
rm -r ../"${distribution}"
done

local windows_dist='Win32 x64'
for distribution in $windows_dist; do
cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
zip -r Windows-VS-16-2019-"${distribution}".zip Windows-VS-16-2019-"${distribution}"
rm -r Windows-VS-16-2019-"${distribution}"
done

cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}/Libiio-Setup-Exe"
mv libiio-setup.exe ../libiio-setup.exe
rm -r ../Libiio-Setup-Exe
}

"${1}"_artifacts
11 changes: 3 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,8 @@ stages:
- task: DownloadPipelineArtifact@2
inputs:
path: '$(Build.ArtifactStagingDirectory)'
- script: |
cd $(Build.ArtifactStagingDirectory)
zip -r ./Windows-VS-16-2019-Win32.zip ./Windows-VS-16-2019-Win32
rm -r ./Windows-VS-16-2019-Win32
zip -r ./Windows-VS-16-2019-x64.zip ./Windows-VS-16-2019-x64
rm -r ./Windows-VS-16-2019-x64
displayName: "Archive windows artifacts"
- bash: ./CI/travis/prepare_assets.sh swdownloads
displayName: "Prepare artifacts for SWDownloads"
- task: DownloadSecureFile@1
name: key
displayName: 'Download rsa key'
Expand All @@ -246,7 +241,7 @@ stages:
- task: DownloadPipelineArtifact@2
inputs:
path: '$(Build.ArtifactStagingDirectory)'
- bash: ./CI/travis/prepare_assets.sh
- bash: ./CI/travis/prepare_assets.sh release
displayName: "Prepare assets for release"
- task: GithubRelease@0
displayName: 'Attach artifacts to GitHub Release'
Expand Down

0 comments on commit 504dc62

Please sign in to comment.