Skip to content

Commit

Permalink
Merge pull request #736 from lovegaoshi/dev
Browse files Browse the repository at this point in the history
feat: newarch build action
  • Loading branch information
lovegaoshi authored Jan 21, 2025
2 parents fe413d2 + 40745f4 commit 472975c
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/android-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
26 changes: 26 additions & 0 deletions scripts/newarch.py
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>'))

0 comments on commit 472975c

Please sign in to comment.