Build release #272
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: Build release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build-ios: | |
runs-on: macOS-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: get-npm-version | |
id: package-version | |
uses: Saionaro/[email protected] | |
with: | |
path: packages/mobile | |
- name: Authenticate to Github packages | |
run: | | |
echo "@homebase-id:registry=https://npm.pkg.github.com" > .npmrc | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc | |
- name: Install npm dependencies | |
run: npm ci | |
# - name: Build libs | |
# run: npm run build:libs | |
- name: Setup Ruby (bundle) | |
uses: ruby/setup-ruby@v1 | |
with: | |
working-directory: packages/mobile | |
ruby-version: 2.7.4 | |
bundler-cache: true | |
cache-version: 1 | |
- name: Bump version | |
uses: yanamura/ios-bump-version@v1 | |
with: | |
version: ${{ steps.package-version.outputs.version}} | |
build-number: ${{github.run_number}} | |
project-path: packages/mobile/ios | |
- name: setup-cocoapods | |
uses: maxim-lobanov/setup-cocoapods@v1 | |
with: | |
podfile-path: packages/mobile/ios/Podfile.lock | |
- name: Install Pods | |
run: pod install --repo-update | |
working-directory: packages/mobile/ios | |
- name: Build IOS App | |
uses: yukiarrr/[email protected] | |
with: | |
project-path: packages/mobile/ios/HomebaseFeed.xcodeproj | |
p12-base64: ${{ secrets.IOS_FEED_P12_BASE64 }} | |
mobileprovision-base64: | | |
${{ secrets.FEED_IOS_MOBILE_PROVISION_BASE64 }} | |
${{ secrets.FEED_APP_GROUP_IOS_MOBILE_PROVISION_BASE64 }} | |
code-signing-identity: "Apple Distribution" | |
team-id: ${{ secrets.IOS_TEAM_ID }} | |
certificate-password: ${{ secrets.IOS_FEED_CERTIFICATE_PASSWORD }} | |
workspace-path: packages/mobile/ios/HomebaseFeed.xcworkspace | |
scheme: HomebaseFeed | |
export-options: packages/mobile/ios/options.plist | |
- name: Rename output | |
run: mv output.ipa homebase-id-app.ipa | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: homebase-id-app-ios | |
path: homebase-id-app.ipa | |
- name: Create Github Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
homebase-id-app.ipa | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: get-npm-version | |
id: package-version | |
uses: Saionaro/[email protected] | |
with: | |
path: packages/mobile | |
- name: Set up Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "zulu" | |
java-version: "17" | |
- name: Bump version | |
uses: chkfung/[email protected] | |
with: | |
gradlePath: packages/mobile/android/app/build.gradle | |
versionCode: ${{github.run_number}} | |
versionName: ${{ steps.package-version.outputs.version }} | |
- name: Authenticate to Github packages | |
run: | | |
echo "@homebase-id:registry=https://npm.pkg.github.com" > .npmrc | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc | |
- name: Install npm dependencies | |
run: npm ci | |
# - name: Build libs | |
# run: npm run build:libs | |
- name: Decode Homebase Keystore to file | |
id: decode_keystore_file | |
env: | |
ENCODED_STRING: ${{ secrets.ANDROID_KEYSTORE_FILE_BASE64_ENCODED }} | |
run: | | |
TMP_KEYSTORE_FILE_PATH="${RUNNER_TEMP}"/keystore | |
mkdir "${TMP_KEYSTORE_FILE_PATH}" | |
KEYSTORE_FILE_PATH="${TMP_KEYSTORE_FILE_PATH}"/homebase.keystore | |
echo $ENCODED_STRING | base64 -di > "${KEYSTORE_FILE_PATH}" | |
echo "KEYSTORE_FILE_PATH=$KEYSTORE_FILE_PATH" >> $GITHUB_OUTPUT | |
- name: Build Android Bundle | |
run: cd packages/mobile/android && ./gradlew bundleRelease | |
env: | |
SIGNING_KEYSTORE_FILE_PATH: ${{ steps.decode_keystore_file.outputs.KEYSTORE_FILE_PATH }} | |
SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} | |
SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_STORE_PASSWORD }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} | |
- name: Rename output | |
run: mv packages/mobile/android/app/build/outputs/bundle/release/app-release.aab packages/mobile/android/app/build/outputs/bundle/release/homebase-id-app.aab | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: homebase-id-app-android | |
path: packages/mobile/android/app/build/outputs/bundle/release/homebase-id-app.aab | |
- name: Create Github Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
packages/mobile/android/app/build/outputs/bundle/release/homebase-id-app.aab | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |