forked from FreeCAD/FreeCAD-Bundle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.cirrus.yml
50 lines (46 loc) · 1.93 KB
/
.cirrus.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
linux_task:
# Basic metadata:
name: appimage-bundle
trigger_type: manual
# The build machine:
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
platform: linux
architecture: arm64
# Environment variables:
env:
DEBIAN_FRONTEND: noninteractive
ASSET_PATTERN: Ondsel_.*Linux-aarch64
DEPLOY_RELEASE: weekly-builds
TARGET_REPO: Ondsel-Development/assets
# Instructions:
bundle_script: |
apt update
apt install curl fuse -y
apt-get download libc6;
dpkg -x libc6*.deb libc6;
curl -LO https://raw.githubusercontent.com/AppImage/AppImages/master/pkg2appimage;
curl -LO https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage;
chmod a+x appimagetool-$(uname -m).AppImage;
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
export HOME='/home/cirrus-ci-build'
bash Miniforge3-$(uname)-$(uname -m).sh -b -p "${HOME}/miniforge3"
source "${HOME}/miniforge3/etc/profile.d/conda.sh"
conda activate
cd conda/linux
bash ./create_bundle.sh
mamba install gh
# store list of existing assets before upload
# exclude files with the same name as new ones
version_name=$(cat bundle_name.txt)
OLD_ASSETS=$(gh release view -R "$TARGET_REPO" "$DEPLOY_RELEASE" --json assets \
--jq ".assets[].name" | grep "$ASSET_PATTERN" | grep -vF $version_name || true; )
# upload new assets
find . -type f -name "Ondsel_*" -exec gh release upload --clobber -R "$TARGET_REPO" "$DEPLOY_RELEASE" {} \;
# remove old assets if upload was successful
if [ -n "$OLD_ASSETS" ]; then
while IFS= read -r asset; do
gh release delete-asset -y -R "$TARGET_REPO" "$DEPLOY_RELEASE" "$asset"
done <<< "$OLD_ASSETS"
fi