Skip to content

Commit

Permalink
fix: build workflow (#2434)
Browse files Browse the repository at this point in the history
* fix: dependencies

* fix: upload-artifacts

* fix deny

* fix manifest path

* fix: semantic permissions

* fix: use app instead of github token

* fix: update version

* fix: rust build

fix token usage

fix: return events back

fix: dependencies

update list of deny

rollback rust

fix: try to use particullar version

return stable back

fix: add test default

fix tiny

disable cache

disable cache

fix: qr reader phone

fix: qr_reader

use target_os

fix: cargo clippy

fix: fmt

fix: remove semantic changes

fix: remove semantic changes

* fix: clippy

fix: clippy

fix: clippy

fix: clippy

fix: clippy

* fix: redundant decrease

* fix: workflows

fix: ations

* fix: versions

* fix cargo.lock

* fix: return small fixes back

* fix: deny config

* fix: clippy

fix clippy

fix clippy

* fix: rollback version to ref

* fix: deny

* fix: macos version

* downgrade opencv

* fix: remove cache

* fix: update opencv usage

* fix: fmt

* fix version in actions

* fix: spellcheck

* fix build script

* fix: build version for ios

* fix: return target_os definition

* fix: rollback ubuntu version

* make directory writable

* downgrade ubuntu

* fix: use latest opencv on ubuntu (#2437)

* fix: use latest opencv on ubuntu

* feat: add using opencv dockerfile

* trigger event

* remove test trigger

* use builded container

* rebuild image

* update build image

* debug

* swithc to root

* fix install dep

* fix source

* fix dependency

* fix dependency

* fix: dependency

* build new image version

* fix source

* fix: build errors

* fix: install dep

* fix: dependency

* fix: dependency

* fix dependency

* fix: remove sudo command

* fix dependency in doc

* fix: update opencv version

* fix: update opencv

* fix: decrease repetition

* try to use action

* use fixed version

* fix version format

* allow arm64 and build libsigner based on platform

* rollback building

---------

Co-authored-by: Russel <emkil.russel@gmail.com>
  • Loading branch information
stepanLav and ERussel authored Feb 20, 2025
1 parent 80e6ef2 commit 695dccc
Show file tree
Hide file tree
Showing 66 changed files with 2,055 additions and 1,881 deletions.
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Ubuntu Development",
"image": "ubuntu:22.04",

"customizations": {
"vscode": {
"extensions": [
"ms-vscode.rust-analyzer"
]
}
},

"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
}
}
20 changes: 20 additions & 0 deletions .github/actions/install-android-dep/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Install Android Dependencies'
description: 'Sets up JDK and Android SDK/NDK'

runs:
using: "composite"
steps:
- name: Set up JDK environment
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17

- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: 12266719

- name: Install NDK
shell: bash
run: echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/16.0/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}
38 changes: 18 additions & 20 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ on:
jobs:
check:
name: Check on MacOS
runs-on: macos-13
runs-on: macos-15
steps:

- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v4.1.1
with:
Expand All @@ -32,22 +27,25 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
bundler-cache: false

- name: Setup - Xcode
run: sudo xcode-select -switch '/Applications/Xcode_15.0.app/Contents/Developer' && /usr/bin/xcodebuild -version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16

- name: Install dependencies
run: |
brew install sourcery
bundle install
- name: Get cached Swift Packages managed by Xcode
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
# - name: Get cached Swift Packages managed by Xcode
# uses: actions/cache@v3
# with:
# path: ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/
# key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
# restore-keys: |
# ${{ runner.os }}-spm-

- name: Install Rust targets
uses: dtolnay/rust-toolchain@stable
Expand All @@ -60,12 +58,12 @@ jobs:
with:
crate: uniffi_bindgen
version: 0.22.0 # Must be in sync with version in Cargo.toml
use-tool-cache: true
use-tool-cache: false

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
workspaces: rust -> rust/target
# - name: Rust Cache
# uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844 # v2.7.7
# with:
# workspaces: rust -> rust/target

- name: Build iOS and run tests
shell: bash
Expand Down
101 changes: 42 additions & 59 deletions .github/workflows/android-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ jobs:
build:
name: Build
runs-on: ubuntu-22.04
container:
image: ghcr.io/${{ github.repository }}/opencv-builder:4.11.0
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}

- name: Checkout Sources
uses: actions/checkout@v4.1.1
Expand All @@ -30,7 +28,7 @@ jobs:
- name: Install System Dependencies (Linux)
run: |
sudo apt-get update
sudo apt-get install -y clang libclang-dev libopencv-dev
sudo apt-get install -y clang libclang-dev
- name: Install Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -40,34 +38,28 @@ jobs:
with:
crate: uniffi_bindgen
version: 0.22.0 # Must be in sync with version in Cargo.toml
use-tool-cache: true
use-tool-cache: false

- name: Install additional rust targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android

- name: Set up JDK environment
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17

- name: Install NDK
run: echo "y" | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
workspaces: rust -> rust/target

- name: Gradle Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Install Android Dependencies
uses: ./.github/actions/install-android-dep

# - name: Rust Cache
# uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844 # v2.7.7
# with:
# workspaces: rust -> rust/target

# - name: Gradle Cache
# uses: actions/cache@v3
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-

- name: Build
run: |
Expand All @@ -76,12 +68,10 @@ jobs:
makeapk:
name: Build unsigned APKs
runs-on: ubuntu-22.04
container:
image: ghcr.io/${{ github.repository }}/opencv-builder:4.11.0
# if: github.ref == ' refs/head/main'
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}

- name: Checkout Sources
uses: actions/checkout@v4.1.1
Expand All @@ -90,10 +80,9 @@ jobs:
submodules: 'recursive'

- name: Install System Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y clang libclang-dev libopencv-dev
sudo apt-get install -y clang libclang-dev
- name: Install Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -103,41 +92,35 @@ jobs:
with:
crate: uniffi_bindgen
version: 0.22.0 # Must be in sync with version in Cargo.toml
use-tool-cache: true
use-tool-cache: false

- name: Install additional rust targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android

- name: Set up JDK environment
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Install Android Dependencies
uses: ./.github/actions/install-android-dep

- name: Install NDK
run: echo "y" | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}
# - name: Rust Cache
# uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844 # v2.7.7
# with:
# workspaces: rust -> rust/target

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
workspaces: rust -> rust/target

- name: Gradle Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# - name: Gradle Cache
# uses: actions/cache@v3
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-

- name: Assemble unsigned debug apk
run: |
./gradlew clean assembleDebug --stacktrace
- name: Upload Gplay unsigned APKs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: signer-debug-unsigned
path: |
Expand Down
Loading

0 comments on commit 695dccc

Please sign in to comment.