update actions #365
This file contains hidden or 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: BuildReleaseApk | |
| on: [push, pull_request] | |
| jobs: | |
| buildReleaseApk: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: "0" | |
| - name: Specify node version | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| cache-dependency-path: package-lock.json | |
| - name: Use specific Java version for sdkmanager to work | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Install node_modules | |
| run: npm ci --omit=dev --yes | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.4.8 | |
| bundler-cache: true | |
| - name: Cache Ruby Gems | |
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5 | |
| with: | |
| path: vendor/bundle | |
| key: ${{ runner.os }}-ruby-${{ hashFiles('**/Gemfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-ruby- | |
| - 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" | |
| - 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" | |
| - name: Build and Sign APK | |
| env: | |
| KEYSTORE_FILE_BASE64: ${{ secrets.KEYSTORE_FILE_BASE64 }} | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| BUILD_NUMBER: ${{ env.NEW_BUILD_NUMBER }} | |
| run: ./scripts/build-release-apk.sh | |
| - name: Upload APK as artifact | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 | |
| with: | |
| 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 | |
| if-no-files-found: error |