2022-04-29 23:49:13 +02:00
|
|
|
name: BuildReleaseApk
|
2024-02-04 01:15:16 +01:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2022-04-29 23:49:13 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
buildReleaseApk:
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout project
|
|
|
|
uses: actions/checkout@v3
|
2023-05-26 21:15:42 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: "0"
|
2022-04-29 23:49:13 +02:00
|
|
|
|
|
|
|
- name: Specify node version
|
2024-05-06 16:08:55 +02:00
|
|
|
uses: actions/setup-node@v4
|
2022-04-29 23:49:13 +02:00
|
|
|
with:
|
2024-06-19 19:18:08 +02:00
|
|
|
node-version: 20
|
2022-04-29 23:49:13 +02:00
|
|
|
|
2024-08-04 21:41:49 +02:00
|
|
|
- name: Use npm caches
|
2022-04-29 23:49:13 +02:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
2024-08-04 21:41:49 +02:00
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
2022-04-29 23:49:13 +02:00
|
|
|
restore-keys: |
|
2024-08-04 21:41:49 +02:00
|
|
|
${{ runner.os }}-npm-
|
2022-04-29 23:49:13 +02:00
|
|
|
|
|
|
|
- name: Use specific Java version for sdkmanager to work
|
2024-07-19 02:50:26 +02:00
|
|
|
uses: actions/setup-java@v3
|
2022-04-29 23:49:13 +02:00
|
|
|
with:
|
|
|
|
distribution: 'temurin'
|
2024-07-22 05:32:40 +02:00
|
|
|
java-version: '17'
|
2022-04-29 23:49:13 +02:00
|
|
|
cache: 'gradle'
|
|
|
|
|
|
|
|
- name: Install node_modules
|
2024-08-04 21:41:49 +02:00
|
|
|
run: npm install --production
|
2022-04-29 23:49:13 +02:00
|
|
|
|
2024-02-04 14:05:18 +01:00
|
|
|
- name: Extract Version Name
|
|
|
|
id: version_name
|
|
|
|
run: |
|
|
|
|
VERSION_NAME=$(grep versionName android/app/build.gradle | awk '{print $2}' | tr -d '"')
|
|
|
|
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
|
|
|
|
echo "::set-output name=version_name::$VERSION_NAME"
|
|
|
|
|
2024-02-04 01:23:00 +01:00
|
|
|
- name: Generate Build Number based on timestamp
|
|
|
|
run: |
|
|
|
|
NEW_BUILD_NUMBER=$(date +%s)
|
|
|
|
echo "NEW_BUILD_NUMBER=$NEW_BUILD_NUMBER" >> $GITHUB_ENV
|
|
|
|
echo "::set-output name=build_number::$NEW_BUILD_NUMBER"
|
|
|
|
|
2022-04-29 23:49:13 +02:00
|
|
|
- name: Build
|
|
|
|
env:
|
|
|
|
KEYSTORE_FILE_HEX: ${{ secrets.KEYSTORE_FILE_HEX }}
|
|
|
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
2024-02-04 01:23:00 +01:00
|
|
|
BUILD_NUMBER: ${{ env.NEW_BUILD_NUMBER }}
|
2022-04-29 23:49:13 +02:00
|
|
|
run: ./scripts/build-release-apk.sh
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: success()
|
|
|
|
with:
|
2024-02-04 14:05:18 +01:00
|
|
|
name: BlueWallet-${{ env.VERSION_NAME }}(${{ env.NEW_BUILD_NUMBER }}).apk
|
|
|
|
path: ./android/app/build/outputs/apk/release/BlueWallet-${{ env.VERSION_NAME }}(${{ env.NEW_BUILD_NUMBER }}).apk
|