-
Notifications
You must be signed in to change notification settings - Fork 65
/
.cirrus.yml
50 lines (46 loc) · 1.92 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
# 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: FreeCAD_.*Linux-aarch64
DEPLOY_RELEASE: weekly-builds
TARGET_REPO: $CIRRUS_REPO_FULL_NAME
# Instructions:
bundle_script: |
if [ -z $CIRRUS_PR ]; then
echo -e ${GPG_KEY} | gpg --batch --import
fi
apt-get update -qq
apt-get upgrade -y
apt-get install -y desktop-file-utils appstream zsync libfuse2 curl
curl -LO https://github.com/AppImage/appimagetool/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 "FreeCAD_*" -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