build: fix select country #657
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Build | |
on: | |
push: | |
branches: | |
- dev* | |
paths: | |
- "app/**" | |
- "buildScript/**" | |
- "buildScr/**" | |
- "libcore/**" | |
- "grade/**" | |
- ".github/workflows/nightly.yml" | |
jobs: | |
libcore: | |
name: Native Build (LibCore) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Golang Status | |
run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status | |
- name: Libcore Status | |
run: git ls-files libcore | xargs cat | sha1sum > libcore_status | |
- name: LibCore Cache | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
app/libs/libcore.aar | |
key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }} | |
- name: Golang Version | |
if: steps.cache.outputs.cache-hit != 'true' | |
id: version | |
run: | | |
source buildScript/init/version.sh | |
echo go_version=$GO_VERSION >> $GITHUB_OUTPUT | |
- name: Install Golang | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ steps.version.outputs.go_version }} | |
cache-dependency-path: libcore/go.sum | |
- uses: actions/setup-java@v4 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
- name: Patch Go | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
cd "$(go env GOROOT)" | |
curl "https://github.com/golang/go/commit/76a8409eb81eda553363783dcdd9d6224368ae0e.patch" | patch --verbose -p 1 | |
- name: Native Build | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
./run lib core | |
- name: Upload libcore | |
uses: actions/upload-artifact@v4 | |
with: | |
path: app/libs/libcore.aar | |
name: "libcore" | |
build: | |
name: Build FOSS APK | |
runs-on: ubuntu-latest | |
needs: | |
- libcore | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: LibCore Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: "libcore" | |
path: app/libs/libcore.aar | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
- name: Gradle cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle | |
key: gradle-foss-${{ hashFiles('**/*.gradle.kts') }} | |
- name: Golang Version | |
if: steps.cache.outputs.cache-hit != 'true' | |
id: version | |
run: | | |
source buildScript/init/version.sh | |
echo go_version=$GO_VERSION >> $GITHUB_OUTPUT | |
- name: Install Golang | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ steps.version.outputs.go_version }} | |
cache-dependency-path: libcore/go.sum | |
- name: Gradle Build | |
env: | |
BUILD_PLUGIN: none | |
run: | | |
echo "sdk.dir=${ANDROID_HOME}" > local.properties | |
# export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" | |
./run init action gradle | |
KEYSTORE_PASS="${{ secrets.KEYSTORE_PASS }}" ALIAS_NAME="${{ secrets.ALIAS_NAME }}" ALIAS_PASS="${{ secrets.ALIAS_PASS}}" ./gradlew clean app:assembleFossDebug | |
# ./gradlew clean app:assembleFossRelease | |
APK=$(find app/build/outputs/apk -name '*arm64-v8a*.apk') | |
APK=$(dirname $APK) | |
rm $APK/output-metadata.json | |
echo "APK=$APK" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: APKs | |
path: ${{ env.APK }} | |
# f-droid: | |
# name: F-Droid Test | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Golang Status | |
# run: find buildScript libcore/*.sh | xargs cat | sha1sum > golang_status | |
# - name: Libcore Status | |
# run: git ls-files libcore | xargs cat | sha1sum > libcore_status | |
# - name: LibCore Cache | |
# id: cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: | | |
# app/libs/libcore.aar | |
# key: ${{ hashFiles('.github/workflows/*', 'golang_status', 'libcore_status') }} | |
# - name: Golang Cache | |
# if: steps.cache.outputs.cache-hit != 'true' | |
# uses: actions/cache@v4 | |
# with: | |
# path: build/golang | |
# key: go-${{ hashFiles('.github/workflows/*', 'golang_status') }} | |
# - name: Get Source | |
# run: | | |
# ./run lib source | |
# - name: Native Build | |
# if: steps.cache.outputs.cache-hit != 'true' | |
# run: ./run fdroid prebuild | |
# - name: Build APK | |
# run: | | |
# ./gradlew app:assembleFdroidDebug |