chore: Simplify pipeline and remove fdroid and appimage support

This commit is contained in:
Krille Fear 2022-08-13 06:49:58 +00:00
parent fdcbb2b625
commit b361688cf1

View File

@ -10,25 +10,25 @@ image: cirrusci/flutter:${FLUTTER_VERSION}
- windows-1809 - windows-1809
stages: stages:
- coverage - test
- release - build
- deploy - deploy
code_analyze: code_analyze:
stage: coverage stage: test
script: [./scripts/code_analyze.sh] script: [./scripts/code_analyze.sh]
artifacts: artifacts:
reports: reports:
codequality: code-quality-report.json codequality: code-quality-report.json
test: widget_test:
stage: coverage stage: test
script: [flutter test] script: [flutter test]
# the basic integration test configuration testing FLOSS builds on Synapse # the basic integration test configuration testing FLOSS builds on Synapse
integration_test: integration_test:
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/integration/stable:${FLUTTER_VERSION} image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/integration/stable:${FLUTTER_VERSION}
stage: coverage stage: test
services: services:
- name: docker:dind - name: docker:dind
alias: docker alias: docker
@ -101,7 +101,7 @@ integration_test_dendrite:
release_mode_launches: release_mode_launches:
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/integration/stable:${FLUTTER_VERSION} image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/integration/stable:${FLUTTER_VERSION}
stage: coverage stage: test
script: script:
# start AVD and keep running in background # start AVD and keep running in background
- scripts/integration-start-avd.sh & - scripts/integration-start-avd.sh &
@ -119,7 +119,7 @@ release_mode_launches_google:
- git apply ./scripts/enable-android-google-services.patch - git apply ./scripts/enable-android-google-services.patch
build_web: build_web:
stage: coverage stage: build
before_script: before_script:
[sudo apt update && sudo apt install curl -y, ./scripts/prepare-web.sh] [sudo apt update && sudo apt install curl -y, ./scripts/prepare-web.sh]
script: [./scripts/build-web.sh] script: [./scripts/build-web.sh]
@ -130,7 +130,7 @@ build_web:
build_windows: build_windows:
extends: extends:
- .shared_windows_runners - .shared_windows_runners
stage: coverage stage: build
before_script: [./scripts/prepare-windows.ps1] before_script: [./scripts/prepare-windows.ps1]
script: [./scripts/build-windows.ps1] script: [./scripts/build-windows.ps1]
artifacts: artifacts:
@ -142,7 +142,7 @@ build_windows:
- tags - tags
build_android_debug: build_android_debug:
stage: coverage stage: build
script: [./scripts/build-android-debug.sh] script: [./scripts/build-android-debug.sh]
artifacts: artifacts:
when: on_success when: on_success
@ -153,7 +153,7 @@ build_android_debug:
- tags - tags
build_android_apk: build_android_apk:
stage: coverage stage: build
before_script: before_script:
- git apply ./scripts/enable-android-google-services.patch - git apply ./scripts/enable-android-google-services.patch
- ./scripts/prepare-android-release.sh - ./scripts/prepare-android-release.sh
@ -166,8 +166,8 @@ build_android_apk:
- main - main
- tags - tags
build_android_appbundle: deploy_playstore_internal:
stage: coverage stage: deploy
before_script: before_script:
- git apply ./scripts/enable-android-google-services.patch - git apply ./scripts/enable-android-google-services.patch
- ./scripts/prepare-android-release.sh - ./scripts/prepare-android-release.sh
@ -180,51 +180,9 @@ build_android_appbundle:
only: only:
- main - main
fdroid_repo:
image: debian:testing
stage: release
before_script:
- apt-get update && apt-get -qy install fdroidserver wget curl jq --no-install-recommends
- ./scripts/prepare-fdroid.sh
script:
- ./scripts/create_fdroid_repos.sh
artifacts:
when: always
paths:
- repo
needs:
- "build_android_apk"
resource_group: playstore_release
allow_failure: true
only:
- main
upload-fdroid:
stage: release
before_script:
- "which ssh-agent || (sudo apt-get update -y && sudo apt-get install openssh-client -y )"
- "which rsync || (sudo apt-get update -y && sudo apt-get install rsync -y )"
- "which pcregrep || (sudo apt-get update -y && sudo apt-get install pcregrep -y )"
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -t rsa ssh.fdroid.nordgedanken.dev >> ~/.ssh/known_hosts
script:
- cd build/android/
- export UPDATE_VERSION=$(pcregrep -o1 'version:\s([0-9]*\.[0-9]*\.[0-9]*)\+[0-9]*' ../../pubspec.yaml) && mv app-release.apk "${UPDATE_VERSION}.apk"
- rsync -rav -e ssh ./ fluffy@ssh.fdroid.nordgedanken.dev:/opt/fdroid/fluffychat/repo
- ssh fluffy@ssh.fdroid.nordgedanken.dev -t '/bin/bash -i -l -c "cd /opt/fdroid/fluffychat && source ../fdroidserver-env/bin/activate && fdroid update --verbose && deactivate"'
needs: ["build_android_apk"]
resource_group: playstore_release
allow_failure: true
only:
- tags
pages: pages:
needs: needs:
- "build_web" - "build_web"
- "fdroid_repo"
stage: deploy stage: deploy
image: node image: node
script: script:
@ -241,7 +199,7 @@ pages:
- main - main
build_linux_x86: build_linux_x86:
stage: coverage stage: build
before_script: before_script:
[ [
sudo apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install keyboard-configuration -y && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 -y, sudo apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install keyboard-configuration -y && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 -y,
@ -253,7 +211,7 @@ build_linux_x86:
- build/linux/x64/release/bundle/ - build/linux/x64/release/bundle/
build_linux_arm64: build_linux_arm64:
stage: coverage stage: build
before_script: [flutter upgrade] before_script: [flutter upgrade]
script: [./scripts/build-linux.sh] script: [./scripts/build-linux.sh]
tags: [docker_arm64] tags: [docker_arm64]
@ -266,51 +224,8 @@ build_linux_arm64:
paths: paths:
- build/linux/arm64/release/bundle/ - build/linux/arm64/release/bundle/
build_linux_appimage_x86: update_dependencies:
stage: deploy stage: build
image: appimagecrafters/appimage-builder
needs: [build_linux_x86]
only:
- main
- tags
script:
- cp -r build/linux/x64/release/bundle appimage/FluffyChat.AppDir
- cd appimage
- cp FluffyChat.desktop FluffyChat.AppDir/
- cp AppRun FluffyChat.AppDir/
- cp ../assets/logo.svg FluffyChat.AppDir/fluffychat.svg
- appimagetool -u "zsync|https://gitlab.com/famedly/fluffychat/-/releases/permalink/latest/downloads/FluffyChat-x86_64.AppImage.zsync" FluffyChat.AppDir
allow_failure: true
artifacts:
when: on_success
paths:
- appimage/FluffyChat-x86_64.AppImage
- appimage/FluffyChat-x86_64.AppImage.zsync
build_linux_appimage_arm64:
stage: deploy
image: appimagecrafters/appimage-builder
needs: [build_linux_arm64]
tags: [docker_arm64]
only:
- main
- tags
script:
- cp -r build/linux/arm64/release/bundle appimage/FluffyChat.AppDir
- cd appimage
- cp FluffyChat.desktop FluffyChat.AppDir/
- cp AppRun FluffyChat.AppDir/
- cp ../assets/logo.svg FluffyChat.AppDir/fluffychat.svg
- appimagetool -u "zsync|https://gitlab.com/famedly/fluffychat/-/releases/permalink/latest/downloads/FluffyChat-arm64.AppImage.zsync" FluffyChat.AppDir
allow_failure: true
artifacts:
when: on_success
paths:
- appimage/FluffyChat-arm64.AppImage
- appimage/FluffyChat-arm64.AppImage.zsync
update-dependencies:
stage: coverage
needs: [] needs: []
tags: tags:
- docker - docker
@ -336,7 +251,7 @@ update-dependencies:
- 'git diff --exit-code || (git checkout -B ${UPDATE_BRANCH} && git add . && git commit -m "chore: Update dependencies" && git push -f origin ${UPDATE_BRANCH} && ./scripts/open-mr.sh)' - 'git diff --exit-code || (git checkout -B ${UPDATE_BRANCH} && git add . && git commit -m "chore: Update dependencies" && git push -f origin ${UPDATE_BRANCH} && ./scripts/open-mr.sh)'
.release: .release:
stage: release stage: deploy
image: curlimages/curl:latest image: curlimages/curl:latest
rules: rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/'
@ -346,38 +261,34 @@ update-dependencies:
- export RELEASE_VERSION=$(echo $CI_COMMIT_TAG | grep -oE "\d+\.\d+\.\d+") - export RELEASE_VERSION=$(echo $CI_COMMIT_TAG | grep -oE "\d+\.\d+\.\d+")
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/fluffychat/${RELEASE_VERSION}" - export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/fluffychat/${RELEASE_VERSION}"
upload-android: upload_android:
extends: .release extends: .release
script: script:
- | - |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build/android/app-release.apk ${PACKAGE_REGISTRY_URL}/fluffychat.apk curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build/android/app-release.apk ${PACKAGE_REGISTRY_URL}/fluffychat.apk
upload-web: upload_web:
extends: .release extends: .release
script: script:
- tar czf package.tar.gz -C build/web/ . - tar czf package.tar.gz -C build/web/ .
- | - |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.tar.gz ${PACKAGE_REGISTRY_URL}/fluffychat-web.tar.gz curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.tar.gz ${PACKAGE_REGISTRY_URL}/fluffychat-web.tar.gz
upload-linux-x86: upload_linux_x86:
extends: .release extends: .release
script: script:
- tar czf package.tar.gz -C build/linux/x64/release/bundle/ . - tar czf package.tar.gz -C build/linux/x64/release/bundle/ .
- | - |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.tar.gz ${PACKAGE_REGISTRY_URL}/fluffychat-linux-x86.tar.gz curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.tar.gz ${PACKAGE_REGISTRY_URL}/fluffychat-linux-x86.tar.gz
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file appimage/FluffyChat-x86_64.AppImage ${PACKAGE_REGISTRY_URL}/FluffyChat-x86_64.AppImage
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file appimage/FluffyChat-x86_64.AppImage.zsync ${PACKAGE_REGISTRY_URL}/FluffyChat-x86_64.AppImage.zsync
upload-linux-arm64: upload_linux_arm64:
extends: .release extends: .release
script: script:
- tar czf package.tar.gz -C build/linux/arm64/release/bundle/ . - tar czf package.tar.gz -C build/linux/arm64/release/bundle/ .
- | - |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.tar.gz ${PACKAGE_REGISTRY_URL}/fluffychat-linux-arm64.tar.gz curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.tar.gz ${PACKAGE_REGISTRY_URL}/fluffychat-linux-arm64.tar.gz
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file appimage/FluffyChat-arm64.AppImage ${PACKAGE_REGISTRY_URL}/FluffyChat-arm64.AppImage
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file appimage/FluffyChat-arm64.AppImage.zsync ${PACKAGE_REGISTRY_URL}/FluffyChat-arm64.AppImage.zsync
upload-windows: upload_windows:
extends: .release extends: .release
image: alpine:latest image: alpine:latest
script: script:
@ -388,8 +299,8 @@ upload-windows:
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.zip ${PACKAGE_REGISTRY_URL}/fluffychat-windows.zip curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package.zip ${PACKAGE_REGISTRY_URL}/fluffychat-windows.zip
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file fluffychat.msix ${PACKAGE_REGISTRY_URL}/fluffychat-windows.msix curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file fluffychat.msix ${PACKAGE_REGISTRY_URL}/fluffychat-windows.msix
upload-playstore: deploy_playstore:
stage: release stage: deploy
before_script: before_script:
- git apply ./scripts/enable-android-google-services.patch - git apply ./scripts/enable-android-google-services.patch
- ./scripts/prepare-android-release.sh - ./scripts/prepare-android-release.sh
@ -411,7 +322,3 @@ release:
--assets-link "{\"name\":\"fluffychat-windows.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-windows.zip\"}" \ --assets-link "{\"name\":\"fluffychat-windows.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-windows.zip\"}" \
--assets-link "{\"name\":\"fluffychat-windows.msix\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-windows.msix\"}" \ --assets-link "{\"name\":\"fluffychat-windows.msix\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-windows.msix\"}" \
--assets-link "{\"name\":\"fluffychat-web.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-web.tar.gz\"}" --assets-link "{\"name\":\"fluffychat-web.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-web.tar.gz\"}"
--assets-link "{\"name\":\"FluffyChat-x86_64.AppImage\",\"url\":\"${PACKAGE_REGISTRY_URL}/FluffyChat-x86_64.AppImage\",\"filepath\":\"/FluffyChat-x86_64.AppImage\"}"
--assets-link "{\"name\":\"FluffyChat-x86_64.AppImage.zsync\",\"url\":\"${PACKAGE_REGISTRY_URL}/FluffyChat-x86_64.AppImage.zsync\",\"filepath\":\"/FluffyChat-x86_64.AppImage.zsync\"}"
--assets-link "{\"name\":\"FluffyChat-arm64.AppImage\",\"url\":\"${PACKAGE_REGISTRY_URL}/FluffyChat-arm64.AppImage\",\"filepath\":\"/FluffyChat-arm64.AppImage\"}"
--assets-link "{\"name\":\"FluffyChat-arm64.AppImage.zsync\",\"url\":\"${PACKAGE_REGISTRY_URL}/FluffyChat-arm64.AppImage.zsync\",\"filepath\":\"/FluffyChat-arm64.AppImage.zsync\"}"