-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
105 lines (92 loc) · 3.11 KB
/
.gitlab-ci.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
image: docker.io/library/fedora:41
variables:
# Change Gradles cache directory to be inside the project directory since we can only cache local items.
GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle_inst"
stages:
- checkUpdates
- build
- publish
checkUpdates:
stage: checkUpdates
tags:
- pi
cache:
- key: LocalPiped-dnf-1
paths:
- .dnf
artifacts:
paths:
- .ci_comm
- component_versions.txt
script:
#- echo "CI_SKIP=0" > .ci_comm
#- exit 0
- ARTIFACT_FOUND=$(curl --silent --write-out "%{http_code}" -L -o component_versions.txt.art "https://$CI_SERVER_HOST/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/-/jobs/artifacts/$CI_COMMIT_REF_SLUG/raw/component_versions.txt?job=checkUpdates")
- if [[ "$ARTIFACT_FOUND" == 200 ]]; then echo 'using component_versions.txt from last run'; mv component_versions.txt.art component_versions.txt; fi
- mkdir -p "$CI_PROJECT_DIR/.dnf/persist" "$CI_PROJECT_DIR/.dnf/cache"
- echo "persistdir=$CI_PROJECT_DIR/.dnf/persist" >> /etc/dnf/dnf.conf
- echo "cachedir=$CI_PROJECT_DIR/.dnf/cache" >> /etc/dnf/dnf.conf
- echo "keepcache=True" >> /etc/dnf/dnf.conf
- dnf install -y git
- ./check_for_component_updates.sh && RES=$? || RES=$?
- if [ $RES == 0 ]; then (echo "CI_SKIP=1" > .ci_comm); elif [ $RES == 10 ]; then (echo "CI_SKIP=0" > .ci_comm); else exit 1; fi
.build-proto:
stage: build
cache:
- key: LocalPiped-gradle-1
paths:
- .gradle_inst
- key: LocalPiped-node-1
paths:
- frontend/Piped/node_modules
- key: LocalPiped-dnf-1
paths:
- .dnf
artifacts:
expire_in: 1 hour
paths:
- Appimage/*.AppImage
script:
- source .ci_comm
- '[ "$CI_SKIP" == 1 ] && echo SKIPPING && exit 0'
- echo installing dependencies...
- mkdir -p "$CI_PROJECT_DIR/.dnf/persist" "$CI_PROJECT_DIR/.dnf/cache"
- echo "persistdir=$CI_PROJECT_DIR/.dnf/persist" >> /etc/dnf/dnf.conf
- echo "cachedir=$CI_PROJECT_DIR/.dnf/cache" >> /etc/dnf/dnf.conf
- echo "keepcache=True" >> /etc/dnf/dnf.conf
- dnf install -y dnf-plugins-core git wget java-21-openjdk-headless pnpm fuse fuse-libs which file
- dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
- dnf install -y --setopt=install_weak_deps=false docker-ce-cli
- echo building...
- cd Appimage
- ./build.sh
build-aarch64:
extends: .build-proto
tags:
- docker
- linux
- aarch64
build-x86_64:
extends: .build-proto
tags:
- docker
- linux
- x86_64
publishAppimage:
stage: publish
tags:
- pi
script:
- source .ci_comm
- '[ "$CI_SKIP" == 1 ] && echo SKIPPING && exit 0'
- echo "GITLAB_HOST=https://$CI_SERVER_HOST" > env.sh
- echo "GITLAB_PROJECT_ID=$CI_PROJECT_ID" >> env.sh
- echo "GITLAB_JOB_TOKEN=$CI_JOB_TOKEN" >> env.sh
#- export PKG_TYPE='AppImage-Test'
- >-
for f in ./Appimage/*.AppImage; do
NEW_PATH="./Appimage/$(basename "$f" | sed "s/-/-$(date -u +'%Y%m%d')-/")";
mv "$f" "$NEW_PATH";
ls -a ./Appimage/;
./uploadArtifact.sh "$NEW_PATH";
done