Skip to content

Commit efdd1ef

Browse files
Update CI
1 parent 716d3ab commit efdd1ef

16 files changed

Lines changed: 277 additions & 242 deletions

.github/workflows/ci-build-android.yml

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/workflows/ci-build-image.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/ci-build-ios.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/workflows/ci-deploy-production.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,65 @@ jobs:
2424
with:
2525
version: ${{ needs.determine-version.outputs.version }}
2626
base-build-artifact-name: ${{ needs.base-build.outputs.artifact_name }}
27+
28+
android-build:
29+
needs: [determine-version, base-build]
30+
uses: ./.github/workflows/reusable-android-build.yml
31+
secrets: inherit
32+
with:
33+
version: ${{ needs.determine-version.outputs.version }}
34+
base-build-artifact-name: ${{ needs.base-build.outputs.artifact_name }}
35+
36+
ios-deploy-app-store:
37+
if: github.ref_type == 'tag'
38+
needs: ios-build
39+
uses: ./.github/workflows/reusable-ios-deployment.yml
40+
secrets: inherit
41+
with:
42+
ios-build-artifact-name: ${{ needs.ios-build.outputs.artifact_name }}
43+
44+
android-deploy-play-store:
45+
if: github.ref_type == 'tag'
46+
needs: android-build
47+
uses: ./.github/workflows/reusable-android-deployment.yml
48+
secrets: inherit
49+
with:
50+
android-build-artifact-name: ${{ needs.android-build.outputs.artifact_name }}
51+
52+
attach-artifacts-to-release:
53+
if: github.ref_type == 'tag'
54+
needs: [ ios-build, android-build ]
55+
runs-on: ubuntu-latest
56+
permissions:
57+
contents: write
58+
steps:
59+
- name: Download iOS build artifact
60+
uses: actions/download-artifact@v4
61+
with:
62+
name: ${{ needs.ios-build.outputs.artifact_name }}
63+
path: release-artifacts
64+
- name: Download android build artifact
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: ${{ needs.android-build.outputs.artifact_name }}
68+
path: release-artifacts
69+
- name: Download web client build artifact
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: ${{ needs.base-build.outputs.artifact_name }}-web-client
73+
path: release-artifacts
74+
- name: Rename artifacts
75+
run: |
76+
mv release-artifacts/macro-deck-client.ipa release-artifacts/macro-deck-client-ios.ipa
77+
mv release-artifacts/apk/release/app-release.apk release-artifacts/macro-deck-client-android.apk
78+
mv release-artifacts/web-client.zip release-artifacts/macro-deck-web-client.zip
79+
- name: Create or update GitHub Release
80+
uses: softprops/action-gh-release@v2
81+
with:
82+
tag_name: ${{ github.ref_name }}
83+
files: |
84+
release-artifacts/macro-deck-client-ios.ipa
85+
release-artifacts/macro-deck-client-android.apk
86+
release-artifacts/macro-deck-web-client.zip
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: reusable-android-build.yml
2+
on:
3+
workflow_call:
4+
inputs:
5+
version:
6+
required: true
7+
type: string
8+
base-build-artifact-name:
9+
required: true
10+
type: string
11+
outputs:
12+
artifact_name:
13+
description: "Name of the uploaded artifact"
14+
value: ${{ jobs.ios-build.outputs.artifact_name }}
15+
16+
env:
17+
KEYSTORE_PATH: "${{ github.workspace }}/keystore.jks"
18+
FIREBASE_CREDENTIALS_PATH: "${{ github.workspace }}/firebase.json"
19+
20+
jobs:
21+
ios-build:
22+
name: Build Android project
23+
runs-on: macos-26
24+
outputs:
25+
artifact_name: ${{ steps.meta.outputs.artifact_name }}
26+
steps:
27+
- name: Check out code
28+
uses: actions/checkout@v5
29+
with:
30+
fetch-depth: 0
31+
- name: Download www base build artifact
32+
uses: actions/download-artifact@v4
33+
with:
34+
name: ${{ inputs.base-build-artifact-name }}-www
35+
path: www/
36+
- name: Download node base build artifact
37+
uses: actions/download-artifact@v4
38+
with:
39+
name: ${{ inputs.base-build-artifact-name }}-node
40+
path: node_modules/
41+
- name: Download android base build artifact
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: ${{ inputs.base-build-artifact-name }}-android
45+
path: android/
46+
- name: "Save signing keystore"
47+
run: base64 -d <<< "${{secrets.ANDROID_KEYSTORE_BASE64}}" > $KEYSTORE_PATH
48+
- name: Set Up JDK
49+
uses: actions/setup-java@v4
50+
with:
51+
distribution: 'temurin'
52+
java-version: |
53+
17
54+
21
55+
cache: 'gradle'
56+
- name: Setup Gradle
57+
uses: gradle/actions/setup-gradle@v4
58+
- name: "Build project"
59+
env:
60+
VERSION_NUMBER: ${{ inputs.version }}
61+
KEYSTORE_FILE_PATH: ${{env.KEYSTORE_PATH}}
62+
KEYSTORE_FILE_PASSWORD: ${{secrets.ANDROID_KEYSTORE_PASSWORD}}
63+
KEYSTORE_FILE_ALIAS: ${{secrets.ANDROID_KEYSTORE_KEY}}
64+
run: |
65+
export BUILD_NUMBER=$(( ${{ github.run_number }} + 3000 ))
66+
cd android
67+
bundle install
68+
fastlane build
69+
- name: Generate artifact name
70+
id: meta
71+
run: |
72+
ARTIFACT_NAME="android-build-${{ inputs.version }}-${GITHUB_RUN_ID}"
73+
echo "artifact_name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT
74+
- uses: actions/upload-artifact@v4
75+
with:
76+
name: ${{ steps.meta.outputs.artifact_name }}
77+
path: |
78+
android/app/build/outputs/apk/release/app-release.apk
79+
android/app/build/outputs/bundle/release/app-release.aab
80+
if-no-files-found: error
81+
retention-days: 1
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: reusable-android-deployment.yml
2+
on:
3+
workflow_call:
4+
inputs:
5+
android-build-artifact-name:
6+
required: true
7+
type: string
8+
9+
jobs:
10+
android-build:
11+
name: Build iOS project
12+
runs-on: macos-26
13+
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
- name: Download android build artifact
19+
uses: actions/download-artifact@v4
20+
with:
21+
name: ${{ inputs.android-build-artifact-name }}
22+
path: android/app/build/outputs
23+
- name: "Deploy project"
24+
env:
25+
PLAYSTORE_CREDENTIALS: ${{secrets.PLAYSTORE_CREDENTIALS}}
26+
run: |
27+
cd android
28+
bundle install
29+
fastlane release

0 commit comments

Comments
 (0)