You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
174 lines
6.7 KiB
174 lines
6.7 KiB
name: Publish |
|
|
|
on: |
|
push: |
|
branches: |
|
- main |
|
|
|
concurrency: |
|
group: publish |
|
cancel-in-progress: true |
|
|
|
env: |
|
PUB_CACHE: ~/.pub-cache |
|
|
|
jobs: |
|
setup: |
|
name: Setup |
|
runs-on: ubuntu-22.04 |
|
outputs: |
|
flutter_version: ${{ steps.flutter_version.outputs.FLUTTER_VERSION }} |
|
build_number: ${{ steps.build_number.outputs.BUILD_NUMBER }} |
|
steps: |
|
- name: Checkout |
|
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 |
|
|
|
- name: Set flutter version |
|
id: flutter_version |
|
run: echo "FLUTTER_VERSION=$(jq ".flutterSdkVersion" -r < .fvm/fvm_config.json | cut -d "@" -f 1)" >> $GITHUB_OUTPUT |
|
- name: Set build number |
|
id: build_number |
|
run: echo "BUILD_NUMBER=$(date +"%s")" >> $GITHUB_OUTPUT |
|
|
|
android: |
|
name: Android |
|
runs-on: ubuntu-22.04 |
|
needs: setup |
|
steps: |
|
- name: Checkout |
|
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 |
|
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2 |
|
with: |
|
flutter-version: ${{ needs.setup.outputs.flutter_version }} |
|
channel: 'stable' |
|
cache: true |
|
- name: Pub dependency cache |
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3 |
|
with: |
|
path: ${{ env.PUB_CACHE }} |
|
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} |
|
restore-keys: | |
|
${{ runner.os }}-pub- |
|
- name: Gradle dependency cache |
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3 |
|
with: |
|
path: | |
|
~/.gradle/caches |
|
~/.gradle/wrapper |
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
|
restore-keys: | |
|
${{ runner.os }}-gradle- |
|
- name: Set up JDK 11 |
|
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3 |
|
with: |
|
distribution: 'adopt' |
|
java-version: 11 |
|
|
|
- name: Build |
|
run: cd packages/app && flutter build apk --split-per-abi --build-number="${{ needs.setup.outputs.build_number }}" |
|
- uses: ilharp/sign-android-release@2034987c31e3959f7c97e88d5e656e52e6e88bd8 # v1 |
|
name: Sign |
|
with: |
|
releaseDir: packages/app/build/app/outputs/flutter-apk |
|
signingKey: ${{ secrets.SIGNING_KEY }} |
|
keyAlias: ${{ secrets.ALIAS }} |
|
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} |
|
keyPassword: ${{ secrets.KEY_PASSWORD }} |
|
|
|
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 |
|
with: |
|
name: Android arm64-v8a |
|
path: packages/app/build/app/outputs/flutter-apk/app-arm64-v8a-release-signed.apk |
|
if-no-files-found: error |
|
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 |
|
with: |
|
name: Android armeabi-v7a |
|
path: packages/app/build/app/outputs/flutter-apk/app-armeabi-v7a-release-signed.apk |
|
if-no-files-found: error |
|
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 |
|
with: |
|
name: Android x86_64 |
|
path: packages/app/build/app/outputs/flutter-apk/app-x86_64-release-signed.apk |
|
if-no-files-found: error |
|
|
|
- name: F-Droid nightly |
|
run: | |
|
cp packages/app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk app-arm64-v8a-debug.apk |
|
cp packages/app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk app-armeabi-v7a-debug.apk |
|
cp packages/app/build/app/outputs/flutter-apk/app-x86_64-release.apk app-x86_64-debug.apk |
|
|
|
sudo add-apt-repository ppa:fdroid/fdroidserver |
|
sudo apt-get update |
|
sudo apt-get install apksigner fdroidserver python3-pip --no-install-recommends |
|
sudo apt-get purge fdroidserver |
|
pip3 install https://gitlab.com/fdroid/fdroidserver/-/archive/master/fdroidserver.tar.gz |
|
export DEBUG_KEYSTORE=${{ secrets.DEBUG_KEYSTORE }} |
|
GITHUB_REPOSITORY=provokateurin/nextcloud-neon fdroid nightly -v --archive-older 10 |
|
|
|
linux_x86_64: |
|
name: Linux x86_64 |
|
runs-on: ubuntu-22.04 |
|
needs: setup |
|
steps: |
|
- name: Checkout |
|
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 |
|
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2 |
|
with: |
|
flutter-version: ${{ needs.setup.outputs.flutter_version }} |
|
channel: 'stable' |
|
cache: true |
|
- name: Pub dependency cache |
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3 |
|
with: |
|
path: ${{ env.PUB_CACHE }} |
|
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} |
|
restore-keys: | |
|
${{ runner.os }}-pub- |
|
- name: Install dependencies |
|
run: | |
|
sudo apt-get install \ |
|
-y --no-install-recommends \ |
|
clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev \ |
|
libappindicator3-dev |
|
|
|
- name: Build |
|
run: cd packages/app && flutter build linux --build-number="${{ needs.setup.outputs.build_number }}" |
|
|
|
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 |
|
with: |
|
name: Linux x86_64 |
|
path: packages/app/build/linux/x64/release/bundle/* |
|
if-no-files-found: error |
|
|
|
linux_arm64: |
|
name: Linux arm64 |
|
runs-on: ubuntu-22.04 |
|
needs: setup |
|
steps: |
|
- name: Checkout |
|
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 |
|
- name: Set docker image |
|
id: docker_image |
|
run: | |
|
echo "local=nextcloud-neon-build-linux-arm64:${{ needs.setup.outputs.flutter_version }}" >> $GITHUB_OUTPUT |
|
echo "remote=ghcr.io/$GITHUB_REPOSITORY/build-linux-arm64:${{ needs.setup.outputs.flutter_version }}" >> $GITHUB_OUTPUT |
|
- run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin |
|
- name: Set up QEMU |
|
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2 |
|
with: |
|
platforms: arm64 |
|
- name: Set up Docker Buildx |
|
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2 |
|
with: |
|
platforms: linux/arm64 |
|
|
|
- name: Build |
|
env: |
|
FLUTTER_VERSION: ${{ needs.setup.outputs.flutter_version }} |
|
run: ./tool/build-app.sh linux/arm64 --build-number="${{ needs.setup.outputs.build_number }}" |
|
|
|
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 |
|
with: |
|
name: Linux arm64 |
|
path: packages/app/build/linux/arm64/release/bundle/* |
|
if-no-files-found: error
|
|
|