CI: Fix snapcraft job

This commit is contained in:
Christian Pauly 2021-03-06 09:33:06 +01:00
parent eb0eca4c0a
commit 8865222032
4 changed files with 51 additions and 54 deletions

View File

@ -6,14 +6,14 @@ variables:
.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
- shared-windows
- windows
- windows-1809
stages:
- coverage
- release
- deploy
- coverage
- release
- deploy
code_analyze:
stage: coverage
@ -25,7 +25,8 @@ test:
build_web:
stage: coverage
before_script: [sudo apt update && sudo apt install curl -y, ./scripts/prepare-web.sh]
before_script:
[sudo apt update && sudo apt install curl -y, ./scripts/prepare-web.sh]
script: [./scripts/build-web.sh]
artifacts:
paths:
@ -44,8 +45,8 @@ build_windows:
- cd ..; git clone https://github.com/flutter/flutter.git -b dev; $env:path += ";C:\GitLab-Runner\builds\famedly\flutter\bin"; cd fluffychat
- flutter doctor
- flutter config --enable-windows-desktop
- "$package_override = \"`r`ndependency_overrides:`r`n intl: 0.17.0-nullsafety.2\""
- "[System.IO.File]::AppendAllText(\"$CI_PROJECT_DIR/pubspec.yaml\", $package_override, [System.Text.Encoding]::UTF8)"
- '$package_override = "`r`ndependency_overrides:`r`n intl: 0.17.0-nullsafety.2"'
- '[System.IO.File]::AppendAllText("$CI_PROJECT_DIR/pubspec.yaml", $package_override, [System.Text.Encoding]::UTF8)'
- flutter clean
- flutter pub get
- flutter build windows
@ -94,9 +95,9 @@ build_android_appbundle:
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 )'
- "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
@ -116,9 +117,9 @@ upload-fdroid:
upload-fdroid-nightly:
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 )'
- "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
@ -156,7 +157,10 @@ pages:
build_linux:
stage: coverage
before_script: [sudo apt update && sudo apt install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev -y]
before_script:
[
sudo apt update && sudo apt install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev -y,
]
script: [./scripts/build-linux.sh]
artifacts:
when: on_success
@ -164,35 +168,36 @@ build_linux:
- build/linux/release/bundle/
allow_failure: true
#snap:edge:
# stage: release
# image: "cibuilds/snapcraft:core18"
# variables:
# SNAPCRAFT_LOGIN_FILE: ${SNAPCRAFT_LOGIN_FILE}
# only:
# - main
# script: [./scripts/publish-snap-edge.sh]
# artifacts:
# paths:
# - './*.snap'
# when: on_success
# allow_failure: true
snap:edge:
stage: release
image: "cibuilds/snapcraft:core18"
variables:
SNAPCRAFT_LOGIN_FILE: ${SNAPCRAFT_LOGIN_FILE}
only:
- main
script: [./scripts/publish-snap-edge.sh]
needs: ["build_linux"]
artifacts:
paths:
- "./*.snap"
when: on_success
allow_failure: true
#snap:publish:
# stage: release
# image: "cibuilds/snapcraft:core18"
# variables:
# SNAPCRAFT_LOGIN_FILE: ${SNAPCRAFT_LOGIN_FILE}
# only:
# - tags
# script: [./scripts/publish-snap-stable.sh]
# artifacts:
# paths:
# - './*.snap'
# when: on_success
# expire_in: 1 week
# needs: []
# allow_failure: true
snap:publish:
stage: release
image: "cibuilds/snapcraft:core18"
variables:
SNAPCRAFT_LOGIN_FILE: ${SNAPCRAFT_LOGIN_FILE}
only:
- tags
script: [./scripts/publish-snap-stable.sh]
needs: ["build_linux"]
artifacts:
paths:
- "./*.snap"
when: on_success
expire_in: 1 week
allow_failure: true
update-dependencies:
stage: coverage

View File

@ -1,8 +0,0 @@
#!/bin/sh -ve
'curl -L $(curl -H "X-Ubuntu-Series: 16" "https://api.snapcraft.io/api/v1/snaps/details/flutter?channel=latest/stable" | jq ".download_url" -r) --output flutter.snap'
sudo mkdir -p /snap/flutter
sudo unsquashfs -d /snap/flutter/current flutter.snap
rm -f flutter.snap
sudo ln -sf /snap/flutter/current/flutter.sh /snap/bin/flutter
sudo ln -sf /snap/flutter/current/env.sh /snap/bin/env.sh
snapcraft

View File

@ -1,5 +1,5 @@
#!/bin/sh -ve
/bin/bash ./scripts/build-snap.sh
snapcraft
echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > snapcraft.login
snapcraft login --with snapcraft.login
snapcraft push --release=edge *.snap

View File

@ -1,5 +1,5 @@
#!/bin/sh -ve
/bin/bash ./scripts/build-snap.sh
snapcraft
echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > snapcraft.login
snapcraft login --with snapcraft.login
snapcraft push --release=stable *.snap