Skip to content

Commit 95ff8d8

Browse files
committed
ci/cd v1
1 parent 651b5ca commit 95ff8d8

9 files changed

Lines changed: 309 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,72 @@ jobs:
1818
- name: Install dependencies and run tests
1919
run: ./gradlew test koverXmlReport
2020
- name: Upload coverage to Codecov
21-
uses: codecov/codecov-action@v3
21+
uses: codecov/codecov-action@v5
22+
env:
23+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
24+
deploy-ios:
25+
runs-on: macos-latest #[ self-hosted, macOS ]
26+
env:
27+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
28+
P8_AUTH_KEY: ${{ secrets.P8_AUTH_KEY }}
29+
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
30+
APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
31+
needs: test
32+
if: github.ref == 'refs/heads/main'
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v3
36+
with:
37+
fetch-depth: 0
38+
- uses: webfactory/ssh-agent@v0.5.0
39+
with:
40+
ssh-private-key: ${{ secrets.MATCH_REPO_KEY }}
41+
- name: Set up our JDK environment
42+
uses: actions/setup-java@v3
43+
with:
44+
distribution: 'temurin'
45+
java-version: 21
46+
- name: Setup Sentry CLI
47+
uses: matbour/setup-sentry-cli@v2
48+
- name: Install Dependencies
49+
run: |
50+
cd ios
51+
bundle install
52+
echo "${{ secrets.P8_AUTH_KEY }}" | base64 -d > fastlane/key.p8
53+
- name: Build and deploy (STAGING)
54+
run: cd ios && bundle exec fastlane ios staging
55+
- name: Build and deploy (PRODUCTION)
56+
run: cd ios && bundle exec fastlane ios production
57+
deploy-android:
58+
runs-on: ubuntu-latest #[ self-hosted, unix ]
59+
needs: test
60+
if: github.ref == 'refs/heads/main'
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v3
64+
with:
65+
fetch-depth: 0
66+
- name: Set up our JDK environment
67+
uses: actions/setup-java@v3
68+
with:
69+
distribution: 'temurin'
70+
java-version: 21
71+
- name: Install Dependencies
72+
run: |
73+
cd android
74+
bundle install
75+
echo "${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}" | base64 -d > fastlane/key.json
76+
echo "${{ secrets.SIGNING_KEY_JKS }}" | base64 -d > fastlane/keystore.jks
77+
- name: Build and deploy (STAGING)
78+
env:
79+
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
80+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
81+
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
82+
run: cd android && bundle exec fastlane android staging
83+
- name: Build and deploy (PRODUCTION)
84+
env:
85+
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
86+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
87+
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
88+
run: cd android && bundle exec fastlane android production
89+

android/fastlane/Appfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
json_key_file("fastlane/key.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
2+
package_name("me.nathanfallet.extopy") # e.g. com.krausefx.app

android/fastlane/Fastfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This file contains the fastlane.tools configuration
2+
# You can find the documentation at https://docs.fastlane.tools
3+
#
4+
# For a list of all available actions, check out
5+
#
6+
# https://docs.fastlane.tools/actions
7+
#
8+
# For a list of all available plugins, check out
9+
#
10+
# https://docs.fastlane.tools/plugins/available-plugins
11+
#
12+
13+
# Uncomment the line if you want fastlane to automatically update itself
14+
# update_fastlane
15+
16+
default_platform(:android)
17+
18+
platform :android do
19+
20+
lane :staging do
21+
distribute(
22+
package_name: "me.nathanfallet.extopy.dev",
23+
flavor: "dev"
24+
)
25+
end
26+
27+
lane :production do
28+
distribute(
29+
package_name: "me.nathanfallet.extopy",
30+
flavor: "production"
31+
)
32+
end
33+
34+
lane :distribute do |options|
35+
package_name = options[:package_name]
36+
flavor = options[:flavor]
37+
38+
increment_version_code(
39+
gradle_file_path: "build.gradle.kts",
40+
version_code: number_of_commits
41+
)
42+
43+
gradle(
44+
task: "bundleRelease",
45+
gradle_path: "../gradlew"
46+
)
47+
48+
upload_to_play_store(
49+
package_name: package_name,
50+
track: "internal",
51+
release_status: "draft",
52+
aab: "build/outputs/bundle/#{flavor}Release/android-#{flavor}-release.aab"
53+
)
54+
end
55+
56+
end

android/fastlane/Pluginfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Autogenerated by fastlane
2+
#
3+
# Ensure this file is checked in to source control!
4+
5+
gem 'fastlane-plugin-increment_version_code'

android/fastlane/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
fastlane documentation
2+
----
3+
4+
# Installation
5+
6+
Make sure you have the latest version of the Xcode command line tools installed:
7+
8+
```sh
9+
xcode-select --install
10+
```
11+
12+
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)
13+
14+
# Available Actions
15+
16+
## Android
17+
18+
### android dev
19+
20+
```sh
21+
[bundle exec] fastlane android dev
22+
```
23+
24+
### android production
25+
26+
```sh
27+
[bundle exec] fastlane android production
28+
```
29+
30+
### android distribute
31+
32+
```sh
33+
[bundle exec] fastlane android distribute
34+
```
35+
36+
----
37+
38+
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
39+
40+
More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).
41+
42+
The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

ios/fastlane/Appfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
app_identifier("me.nathanfallet.Extopy") # The bundle identifier of your app
2+
apple_id("contact@nathanfallet.me") # Your Apple Developer Portal username
3+
4+
itc_team_id("119076755") # App Store Connect Team ID
5+
team_id("ZL9396WK65") # Developer Portal Team ID
6+
7+
# For more information about the Appfile, see:
8+
# https://docs.fastlane.tools/advanced/#appfile

ios/fastlane/Fastfile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This file contains the fastlane.tools configuration
2+
# You can find the documentation at https://docs.fastlane.tools
3+
#
4+
# For a list of all available actions, check out
5+
#
6+
# https://docs.fastlane.tools/actions
7+
#
8+
# For a list of all available plugins, check out
9+
#
10+
# https://docs.fastlane.tools/plugins/available-plugins
11+
#
12+
13+
# Uncomment the line if you want fastlane to automatically update itself
14+
# update_fastlane
15+
16+
default_platform(:ios)
17+
18+
platform :ios do
19+
20+
lane :staging do
21+
distribute(
22+
app_identifier: "me.nathanfallet.Extopy.dev",
23+
scheme: "Extopy Dev"
24+
)
25+
end
26+
27+
lane :production do
28+
distribute(
29+
app_identifier: "me.nathanfallet.Extopy",
30+
scheme: "Extopy"
31+
)
32+
end
33+
34+
lane :distribute do |options|
35+
app_identifier = options[:app_identifier]
36+
scheme = options[:scheme]
37+
xcodeproj = "Extopy.xcodeproj"
38+
39+
setup_ci
40+
api_key = app_store_connect_api_key(
41+
key_id: ENV["APPSTORE_KEY_ID"],
42+
issuer_id: ENV["APPSTORE_ISSUER_ID"],
43+
key_filepath: "fastlane/key.p8"
44+
)
45+
46+
increment_build_number(
47+
build_number: number_of_commits,
48+
xcodeproj: xcodeproj
49+
)
50+
51+
match
52+
update_code_signing_settings(
53+
use_automatic_signing: false,
54+
profile_name: "match AppStore #{app_identifier}",
55+
code_sign_identity: "iPhone Distribution",
56+
path: xcodeproj
57+
)
58+
build_app(
59+
scheme: scheme,
60+
xcargs: "-allowProvisioningUpdates"
61+
)
62+
63+
upload_to_testflight(
64+
api_key: api_key,
65+
app_identifier: app_identifier,
66+
skip_waiting_for_build_processing: true
67+
)
68+
69+
clean_build_artifacts
70+
end
71+
72+
end

ios/fastlane/Matchfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
git_url("git@github.com:groupeminaste/match.git")
2+
git_branch("groupeminaste")
3+
storage_mode("git")
4+
5+
type("appstore") # The default type, can be: appstore, adhoc, enterprise or development
6+
7+
app_identifier(["me.nathanfallet.Extopy", "me.nathanfallet.Extopy.dev"])
8+
username("contact@nathanfallet.me") # Your Apple Developer Portal username
9+
10+
# For all available options run `fastlane match --help`
11+
# Remove the # in the beginning of the line to enable the other options
12+
13+
# The docs are available on https://docs.fastlane.tools/actions/match

ios/fastlane/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
fastlane documentation
2+
----
3+
4+
# Installation
5+
6+
Make sure you have the latest version of the Xcode command line tools installed:
7+
8+
```sh
9+
xcode-select --install
10+
```
11+
12+
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)
13+
14+
# Available Actions
15+
16+
## iOS
17+
18+
### ios dev
19+
20+
```sh
21+
[bundle exec] fastlane ios dev
22+
```
23+
24+
### ios production
25+
26+
```sh
27+
[bundle exec] fastlane ios production
28+
```
29+
30+
### ios distribute
31+
32+
```sh
33+
[bundle exec] fastlane ios distribute
34+
```
35+
36+
----
37+
38+
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
39+
40+
More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).
41+
42+
The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

0 commit comments

Comments
 (0)