Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/ci-test'
Browse files Browse the repository at this point in the history
  • Loading branch information
proninyaroslav committed Aug 11, 2024
1 parent 1f657f0 commit 769f68e
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 34 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/flutter_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.24.x"
Expand All @@ -20,6 +24,6 @@ jobs:
- name: Build debug Android APK
run: flutter build apk --flavor base --debug
- name: Install Linux dependencies
run: sudo apt update && sudo apt install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libjsoncpp1 libsecret-1-dev libsecret-1-0 librhash0 libsqlite3-dev libappindicator3-dev gettext -y
run: sudo apt update && sudo apt install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libjsoncpp25 libsecret-1-dev libsecret-1-0 librhash0 libsqlite3-dev libappindicator3-dev gettext -y
- name: Build debug Linux binary
run: flutter build linux --debug
126 changes: 102 additions & 24 deletions .github/workflows/flutter_release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ name: Flutter Release Build CI
on:
release:
types: [prereleased]
workflow_dispatch:

permissions:
contents: write

env:
FLUTTER_VERSION: "3.24.0"
LINUX_DEPENDENCIES: git unzip zip xz-utils curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libjsoncpp1 libsecret-1-dev libsecret-1-0 librhash0 libsqlite3-dev libappindicator3-dev gettext
LINUX_DEPENDENCIES: git unzip zip xz-utils curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libjsoncpp25 libsecret-1-dev libsecret-1-0 librhash0 libsqlite3-dev libappindicator3-dev gettext

jobs:
build-linux-x86_64:
Expand All @@ -16,6 +18,9 @@ jobs:
env:
TARBALL_NAME: libretrack-${{ github.event.release.tag_name }}-linux-x86_64.tar.gz

outputs:
hashsum: ${{ steps.gen-hashsum.outputs.hashsum }}

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand All @@ -32,33 +37,40 @@ jobs:
- name: Build
run: flutter build linux --release
- name: Create tarball
id: create-tar
run: |
cd build/linux/x64/release/bundle
tar -czf ../${{ env.TARBALL_NAME }} *
echo "assets-path=build/linux/x64/release" >> "$GITHUB_OUTPUT"
- name: Generate hashsum
id: gen-hashsum
run: |
cd ${{ steps.create-tar.outputs.assets-path }}
echo "hashsum=$(sha256sum ${{ env.TARBALL_NAME }})" >> "$GITHUB_OUTPUT"
- name: Upload assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/linux/x64/release/${{ env.TARBALL_NAME }}
asset_name: ${{ env.TARBALL_NAME }}
asset_content_type: application/gzip
prerelease: true
files: ${{ steps.create-tar.outputs.assets-path }}/${{ env.TARBALL_NAME }}

build-linux-arm64:
runs-on: ubuntu-latest

env:
TARBALL_NAME: libretrack-${{ github.event.release.tag_name }}-linux-arm64.tar.gz

outputs:
hashsum: ${{ steps.gen-hashsum.outputs.hashsum }}

steps:
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
name: Build
id: build
with:
arch: aarch64
distro: ubuntu20.04
distro: ubuntu22.04
githubToken: ${{ github.token }}
# Create an artifacts directory
setup: |
Expand All @@ -78,15 +90,17 @@ jobs:
echo "::set-output name=assets-path::${PWD}/artifacts"
cd build/linux/arm64/release/bundle
tar -czf /artifacts/${{ env.TARBALL_NAME }} *
- name: Generate hashsum
id: gen-hashsum
run: |
cd ${{ steps.build.outputs.assets-path }}
echo "::set-output name=hashsum::$(sha256sum ${{ env.TARBALL_NAME }})"
- name: Upload assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.build.outputs.assets-path }}/${{ env.TARBALL_NAME }}
asset_name: ${{ env.TARBALL_NAME }}
asset_content_type: application/gzip
prerelease: true
files: ${{ steps.build.outputs.assets-path }}/${{ env.TARBALL_NAME }}

build-linux-snap:
runs-on: ubuntu-latest
Expand All @@ -107,12 +121,76 @@ jobs:
id: snapcraft
with:
architecture: ${{ matrix.platform }}
- uses: actions/upload-release-asset@v1
name: Upload assets
- name: Upload assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
files: ${{ steps.snapcraft.outputs.snap }}

build-android-debug:
runs-on: ubuntu-latest

env:
APK_NAME: LibreTrack-${{ github.event.release.tag_name }}-debug.apk

outputs:
versionNum: ${{ steps.apk-info.outputs.versionNum }}
versionCode: ${{ steps.apk-info.outputs.versionCode }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Disable Google Analytics
run: flutter config --no-analytics
- name: Install dependencies
run: flutter pub get
- name: Build debug Android APK
id: build
run: |
flutter build apk --flavor base --debug
cd build/app/outputs/flutter-apk/
mv app-base-debug.apk "$APK_NAME"
echo "assets-path=build/app/outputs/flutter-apk" >> "$GITHUB_OUTPUT"
- name: Extract APK version code
id: apk-info
uses: 8Mi-Tech/get-apk-info-action@master
with:
apkPath: ${{ steps.build.outputs.assets-path }}/${{ env.APK_NAME }}

generate-metadata-assets:
runs-on: ubuntu-latest

needs: [build-linux-x86_64, build-linux-arm64, build-android-debug]

env:
HASHSUM_FILE: hashsum.txt
VERSION_FILE: version.txt

steps:
- uses: actions/checkout@v4
- name: Create assests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HASHSUM_AMD64: ${{ needs.build-linux-x86_64.outputs.hashsum }}
HASHSUM_ARM64: ${{ needs.build-linux-arm64.outputs.hashsum }}
ANDROID_BUILD_NAME: ${{ needs.build-android-debug.outputs.versionNum }}
ANDROID_BUILD_NUMBER: ${{ needs.build-android-debug.outputs.versionCode }}
run: |
echo "$HASHSUM_AMD64" >> $HASHSUM_FILE
echo "$HASHSUM_ARM64" >> $HASHSUM_FILE
echo "android-build-name=$ANDROID_BUILD_NAME" >> $VERSION_FILE
echo "android-build-number=$ANDROID_BUILD_NUMBER" >> $VERSION_FILE
- name: Upload assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.snapcraft.outputs.snap }}
asset_name: ${{ env.SNAP_NAME }}
asset_content_type: application/octet-stream
prerelease: true
files: |
${{ env.HASHSUM_FILE }}
${{ env.VERSION_FILE }}
2 changes: 1 addition & 1 deletion linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ endif()
# default. In most cases, you should add new options to specific targets instead
# of modifying this function.
function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_features(${TARGET} PUBLIC cxx_std_14)
target_compile_features(${TARGET} PUBLIC cxx_std_17)
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
Expand Down
16 changes: 8 additions & 8 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: libretrack
base: core18
version: 1.4.0
base: core22
version: 1.4.2
license: GPL-3.0-or-later
summary: Private, cross-platform package tracking app.
description: |
Expand All @@ -26,14 +26,14 @@ grade: stable
confinement: strict

architectures:
- build-on: amd64
run-on: amd64
- build-on: arm64
run-on: arm64
- build-on: [amd64]
build-for: [amd64]
- build-on: [amd64, arm64]
build-for: [arm64]

apps:
libretrack:
extensions: [flutter-stable]
extensions: [gnome]
command: libretrack
plugs:
- network
Expand All @@ -43,7 +43,7 @@ parts:
libretrack:
plugin: flutter
source: https://github.com/proninyaroslav/libretrack.git
source-tag: 1.4.0
source-tag: 1.4.2
flutter-target: lib/main.dart
build-packages:
- libsecret-1-dev
Expand Down

0 comments on commit 769f68e

Please sign in to comment.