-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #736 from lovegaoshi/dev
feat: newarch build action
- Loading branch information
Showing
2 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,3 +135,99 @@ jobs: | |
files: android/app/build/outputs/apk/release/app-arm64-v8a-release.apk | ||
prerelease: true | ||
target_commitish: ${{ env.GIT_BRANCH }} | ||
buildNewArch: | ||
name: Build-new-arch | ||
runs-on: ubuntu-latest | ||
needs: checkLastCommit | ||
if: ${{ needs.checkLastCommit.outputs.is_old_commit == false }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
# this might remove tools that are actually needed, | ||
# if set to "true" but frees about 6 GB | ||
tool-cache: false | ||
|
||
# all of these default to true, but feel free to set to | ||
# "false" if necessary for your workflow | ||
android: false | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
docker-images: true | ||
swap-storage: false | ||
|
||
- name: Get branch name | ||
run: | | ||
# Short name for current branch. For PRs, use target branch (base ref) | ||
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}} | ||
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
|
||
- name: set up JDK 18 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 18 | ||
distribution: temurin | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Setup Yarn | ||
uses: threeal/[email protected] | ||
|
||
- name: 'Create env file' | ||
run: | | ||
echo "${{ secrets.ENV_FILE }}" > .env | ||
echo "${{ secrets.SENTRY_PROPERTIES }}" > ./android/sentry.properties | ||
- name: alias yarn.cmd to yarn | ||
run: alias yarn.cmd="yarn" | ||
|
||
- name: Add Build Sign Keys | ||
run: | | ||
git submodule update --init --recursive | ||
echo "${{ secrets.RELEASE_SIGN_PWD }}" >> ./android/gradle.properties | ||
- name: python fixHTTP | ||
run: | | ||
python ./scripts/newarch.py | ||
python ./scripts/dev_cleartext.py | ||
python ./scripts/release_bump.py --dev | ||
- name: Build Sign jks | ||
id: write_file | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: 'noxupload.jks' | ||
fileDir: './android/app' | ||
encodedString: ${{ secrets.SIGNED_KEY_BASE64 }} | ||
|
||
- name: Install dependencies | ||
run: yarn install; yarn postinstall | ||
|
||
- name: clean generated builds | ||
run: rm -rf android/app/build/generated/ | ||
|
||
- name: gradle build | ||
run: | | ||
cd android && chmod +x gradlew && ./gradlew assembleRelease | ||
mv android/app/build/outputs/apk/release/app-arm64-v8a-release.apk android/app/build/outputs/apk/release/app-newarch-arm64-v8a-release.apk | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: ${{ env.GIT_BRANCH }}-build-${{ steps.date.outputs.date }} | ||
files: android/app/build/outputs/apk/release/app-newarch-arm64-v8a-release.apk | ||
prerelease: true | ||
target_commitish: ${{ env.GIT_BRANCH }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from dev_cleartext import fix_content | ||
|
||
if __name__ == '__main__': | ||
fix_content( | ||
'android/gradle.properties', | ||
lambda l: l.replace('newArchEnabled=false', 'newArchEnabled=true')) | ||
fix_content( | ||
'android/app/src/main/AndroidManifest.xml', | ||
lambda l: l.replace( | ||
'android:authorities="com.noxplay.noxplayer.provider"', | ||
'android:authorities="com.noxplay.noxplayer.new.provider"')) | ||
fix_content( | ||
'android/app/build.gradle', | ||
lambda l: l.replace( | ||
'applicationId "com.noxplay.noxplayer"', | ||
'applicationId "com.noxplay.noxplayer.new"')) | ||
fix_content( | ||
'android/app/src/main/res/values/strings.xml', | ||
lambda l: l.replace( | ||
'<string name="app_name">APM</string>', | ||
'<string name="app_name">APM.new</string>')) | ||
fix_content( | ||
'android/app/src/main/res/values-zh/strings.xml', | ||
lambda l: l.replace( | ||
'<string name="app_name">APM</string>', | ||
'<string name="app_name">APM.new</string>')) |