-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #636 from fmidev/feature/635-pipeline-for-main-branch
issue-635: The latest build from main branch
- Loading branch information
Showing
3 changed files
with
218 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# This is workflow to build Android app for testing | ||
|
||
name: The latest Android build from main-branch | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: [ "main" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
# Build job needs test ! | ||
jobs: | ||
|
||
# Run React Native Eslint and Jest tests | ||
test: | ||
if: ${{ false }} | ||
name: Test | ||
# Setup Ubuntu version | ||
runs-on: ubuntu-latest | ||
strategy: | ||
# Node version matrix | ||
matrix: | ||
node-version: [20.11.1] | ||
# Steps | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
# Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'yarn' | ||
# Install dependencies | ||
- name: Install dependencies | ||
run: yarn install | ||
# Get defaultConfig | ||
- name: Get defaultConfig | ||
env: | ||
defaultConfig: ${{ secrets.DEFAULTCONFIG }} | ||
shell: bash | ||
run: | | ||
touch defaultConfig.ts | ||
echo "$defaultConfig" >> defaultConfig.ts | ||
# Run lint -tests | ||
- name: Run Eslint tests | ||
if: ${{ false }} | ||
run: yarn lint --fix | ||
# Run Jest -tests | ||
- name: Run Jest tests | ||
if: ${{ false }} | ||
run: yarn test | ||
|
||
# Decode, Build and sign Android application | ||
build: | ||
# needs: test | ||
name: Android-build | ||
# Set Ubuntu version | ||
runs-on: ubuntu-latest | ||
# Node version matrix | ||
strategy: | ||
matrix: | ||
node-version: [20.11.1] | ||
# Steps | ||
steps: | ||
- name: Checkout to git repository | ||
uses: actions/checkout@v4 | ||
# Setup Node | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'yarn' | ||
- name: Install dependencies | ||
run: | | ||
yarn install | ||
# Get defaultConfig | ||
- name: Get defaultConfig | ||
env: | ||
defaultConfig: ${{ secrets.DEFAULTCONFIG }} | ||
shell: bash | ||
run: | | ||
touch defaultConfig.ts | ||
echo "$defaultConfig" >> defaultConfig.ts | ||
# Set up Java 17 | ||
- name: Set up Java 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' # You can use 'adopt', 'zulu', or another distribution if needed | ||
|
||
# Install Ruby | ||
- name: Install Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.3.0' | ||
|
||
# Update bundler | ||
- name: Update bundler | ||
run: bundle update --bundler | ||
working-directory: android | ||
|
||
# Bundle install | ||
- name: Bundle install | ||
run: gem install bundler && bundle install | ||
working-directory: android | ||
|
||
# Decode upload keystore | ||
- name: Decode Keystore File | ||
uses: timheuer/base64-to-file@v1 | ||
id: android_keystore | ||
with: | ||
fileName: "android_keystore.keystore" | ||
encodedString: ${{ secrets.KEYSTORE }} | ||
|
||
# Build and sign | ||
- name: Build | ||
env: | ||
KEYSTORE: ${{ steps.android_keystore.outputs.filePath }} | ||
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} | ||
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | ||
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | ||
# SLACK_WEB_HOOK_URL: ${{ secrets.SLACK_WEB_HOOK_URL }} | ||
run: | | ||
echo "GOOGLE_MAPS_API_KEY=${{ secrets.GOOGLE_MAPS_API_KEY }}" > .env | ||
chmod +x ./gradlew | ||
bundle exec fastlane android build_apk | ||
working-directory: android | ||
|
||
- name: Rename APK | ||
run: | ||
mv "./app/build/outputs/apk/release/app-release.apk" "./app/build/outputs/apk/release/latest.apk" | ||
working-directory: android | ||
|
||
# Upload artifact | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: latest.apk | ||
path: | | ||
${{ github.workspace }}/android/app/build/outputs/apk/release/latest.apk | ||
retention-days: 7 | ||
overwrite: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,72 @@ | ||
fastlane documentation | ||
================ | ||
---- | ||
|
||
# Installation | ||
|
||
Make sure you have the latest version of the Xcode command line tools installed: | ||
|
||
``` | ||
```sh | ||
xcode-select --install | ||
``` | ||
|
||
Install _fastlane_ using | ||
``` | ||
[sudo] gem install fastlane -NV | ||
``` | ||
or alternatively using `brew install fastlane` | ||
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) | ||
|
||
# Available Actions | ||
|
||
## Android | ||
### android increment_version | ||
``` | ||
fastlane android increment_version | ||
|
||
### android increment_android_version | ||
|
||
```sh | ||
[bundle exec] fastlane android increment_android_version | ||
``` | ||
|
||
Increment build and version number and push to repository - Build number = version code, version number = version name | ||
|
||
### android build_apk | ||
|
||
```sh | ||
[bundle exec] fastlane android build_apk | ||
``` | ||
|
||
Android build APK | ||
|
||
### android build_sign_and_deploy | ||
|
||
```sh | ||
[bundle exec] fastlane android build_sign_and_deploy | ||
``` | ||
|
||
Sign, build, and deploy to Google Play Store | ||
|
||
### android get_version_code_and_version_name | ||
|
||
```sh | ||
[bundle exec] fastlane android get_version_code_and_version_name | ||
``` | ||
|
||
Get version code and version name | ||
|
||
### android build_and_sign | ||
|
||
```sh | ||
[bundle exec] fastlane android build_and_sign | ||
``` | ||
|
||
Release for the Android beta | ||
|
||
### android deploy | ||
|
||
```sh | ||
[bundle exec] fastlane android deploy | ||
``` | ||
|
||
Deploy a new version to the Google Play | ||
|
||
---- | ||
|
||
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. | ||
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). | ||
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). | ||
|
||
More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). | ||
|
||
The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). |