Merge pull request #683 from lovegaoshi/dev #144
Workflow file for this run
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: APM Automatic Release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
workflow_dispatch: | |
jobs: | |
buildAPK: | |
runs-on: ubuntu-latest | |
name: build APK | |
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: python version_bump.py | |
run: | | |
python ./scripts/version_bump.py | |
- 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: Get Recent Commit Tag | |
id: get_commit_tag | |
run: | | |
COMMIT_TAG=$(git describe --tags --abbrev=0) | |
echo "COMMIT_TAG=${COMMIT_TAG}" >> $GITHUB_ENV | |
- name: Display Commit Tag | |
run: | | |
echo "Commit Tag: $COMMIT_TAG" | |
- name: Add Build Sign Keys | |
run: | | |
git submodule update --init --recursive | |
echo "${{ secrets.RELEASE_SIGN_PWD }}" >> ./android/gradle.properties | |
- name: commit | |
run: | | |
git config --global user.email [email protected] | |
git config --global user.name lovegaoshi | |
git commit -m "build: release version bump" -a | |
- name: python fixHTTP | |
run: | | |
python ./scripts/fixHTTP.py | |
- 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: codepush to prod | |
# run: | | |
# npm install -g appcenter-cli | |
# yarn codepush --token ${{secrets.CODEPUSH_ACCESS_TOKEN}} | |
# yarn codepush:promote --token ${{secrets.CODEPUSH_ACCESS_TOKEN}} | |
- name: gradle build APK | |
run: cd android && chmod +x gradlew && ./gradlew assembleRelease | |
- name: Release APK | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: 'Release ${{env.COMMIT_TAG}}' | |
tag_name: '${{env.COMMIT_TAG}}' | |
files: android/app/build/outputs/apk/release/*.apk | |
generate_release_notes: true | |
buildAAB: | |
runs-on: ubuntu-latest | |
name: build AAB | |
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: python version_bump.py | |
run: | | |
python ./scripts/version_bump.py | |
- 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 "APPSTORE=true" >> .env | |
echo "${{ secrets.SENTRY_PROPERTIES }}" > ./android/sentry.properties | |
- name: alias yarn.cmd to yarn | |
run: alias yarn.cmd="yarn" | |
- name: Get Recent Commit Tag | |
id: get_commit_tag | |
run: | | |
COMMIT_TAG=$(git describe --tags --abbrev=0) | |
echo "COMMIT_TAG=${COMMIT_TAG}" >> $GITHUB_ENV | |
- name: Display Commit Tag | |
run: | | |
echo "Commit Tag: $COMMIT_TAG" | |
- name: commit | |
run: | | |
git config --global user.email [email protected] | |
git config --global user.name lovegaoshi | |
git commit -m "build: release version bump" -a | |
git tag $COMMIT_TAG-fdroid | |
- name: Push changes to master | |
uses: ad-m/github-push-action@master | |
with: | |
tags: true | |
- 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/fixHTTP.py | |
- 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 AAB | |
run: cd android && chmod +x gradlew && ./gradlew bundleRelease | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: outputAAB | |
path: android/app/build/outputs/bundle/release/*.aab # or path/to/artifact | |
- uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} | |
packageName: com.noxplay.noxplayer | |
releaseFiles: android/app/build/outputs/bundle/release/app-release.aab | |
track: internal | |
#changesNotSentForReview: true | |
buildIPA: | |
runs-on: macos-14 | |
name: build IPA | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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 "APPSTORE=true" >> .env | |
echo "${{ secrets.SENTRY_PROPERTIES }}" > ./ios/sentry.properties | |
git submodule update --init --recursive | |
- name: alias yarn.cmd to yarn | |
run: alias yarn.cmd="yarn" | |
- name: Get Recent Commit Tag | |
id: get_commit_tag | |
run: | | |
COMMIT_TAG=$(git describe --tags --abbrev=0) | |
echo "COMMIT_TAG=${COMMIT_TAG}" >> $GITHUB_ENV | |
- name: Display Commit Tag | |
run: | | |
echo "Commit Tag: $COMMIT_TAG" | |
- name: Install dependencies | |
run: yarn install; yarn postinstall | |
- name: Pod Install | |
run: cd ios && rm Podfile.lock && pod install --repo-update | |
- name: python fixHTTP | |
run: | | |
python ./scripts/fixHTTP.py | |
python ./scripts/fixiOSBuild.py | |
- name: build | |
run: cd ios && xcodebuild -scheme APM -workspace example.xcworkspace -configuration Release clean archive -archivePath "build/APM.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | |
- name: archive to ipa | |
run: | | |
cd ios | |
mkdir build/Payload | |
mv build/APM.xcarchive/Products/Applications/AzusaPlayer.app build/Payload/AzusaPlayer.app | |
cd build | |
zip -r APM.ipa Payload/ | |
- name: Release IPA | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: 'Release ${{env.COMMIT_TAG}}' | |
tag_name: '${{env.COMMIT_TAG}}' | |
files: ios/build/APM.ipa | |
generate_release_notes: true |