Skip to content

Commit 86a7107

Browse files
Merge pull request #164 from DefGuard/release/1.6-alpha-merger
Merge main -> release/1.6-alpha
2 parents cbefcbd + 8c243f3 commit 86a7107

6 files changed

Lines changed: 78 additions & 32 deletions

File tree

.github/workflows/build.yaml

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,63 @@ jobs:
138138
path: "client/build/app/outputs/bundle/release/app-release.aab"
139139
retention-days: 2
140140

141+
build-android-apk:
142+
runs-on: [self-hosted, macOS]
143+
env:
144+
ANDROID_HOME: /Users/admin/Library/Android/sdk
145+
ANDROID_SDK_ROOT: /Users/admin/Library/Android/sdk
146+
defaults:
147+
run:
148+
working-directory: ./client
149+
steps:
150+
- uses: actions/checkout@v4
151+
152+
- name: Set up Java
153+
uses: actions/setup-java@v3
154+
with:
155+
distribution: "temurin"
156+
java-version: "17"
157+
158+
- name: Setup flutter
159+
uses: subosito/flutter-action@v2
160+
with:
161+
channel: stable
162+
flutter-version: 3.32.7
163+
164+
- name: Install Android SDK components
165+
run: |
166+
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'build-tools;29.0.3'
167+
- name: Accept licenses
168+
run: yes | flutter doctor --android-licenses
169+
170+
- name: Clean flutter
171+
run: flutter clean
172+
173+
- name: Install deps
174+
run: flutter pub get
175+
176+
- name: Build Android APK
177+
run: flutter build apk --release --build-number=${{ github.run_number }}
178+
179+
- name: Sign APK
180+
uses: r0adkll/sign-android-release@v1
181+
with:
182+
releaseDirectory: client/build/app/outputs/flutter-apk
183+
signingKeyBase64: "${{ secrets.ANDROID_SIGNING_KEY_BASE64 }}"
184+
alias: "${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}"
185+
keyStorePassword: "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
186+
keyPassword: "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}"
187+
188+
- name: Upload Android Artifact
189+
uses: actions/upload-artifact@v4
190+
if: startsWith(github.ref, 'refs/tags/')
191+
with:
192+
name: android-app-apk
193+
path: "client/build/app/outputs/flutter-apk/app-release.apk"
194+
retention-days: 2
195+
141196
release:
142-
needs: [build-ios, build-android]
197+
needs: [build-ios, build-android, build-android-apk]
143198
# Create release only if CI was triggered by a tag.
144199
if: startsWith(github.ref, 'refs/tags/')
145200
uses: ./.github/workflows/release.yaml
146-
secrets:
147-
PRIVATE_REPO_CLONING_TOKEN: ${{ secrets.PRIVATE_REPO_CLONING_TOKEN }}

.github/workflows/lint-and-test.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- main
77
- dev
8-
- 'release/**'
9-
- 'hotfix/**'
8+
- "release/**"
9+
- "hotfix/**"
1010
paths-ignore: &ignored_paths
1111
- "*.md"
1212
- "LICENSE"
@@ -15,8 +15,8 @@ on:
1515
branches:
1616
- main
1717
- dev
18-
- 'release/**'
19-
- 'hotfix/**'
18+
- "release/**"
19+
- "hotfix/**"
2020
paths-ignore: *ignored_paths
2121

2222
jobs:
@@ -34,8 +34,8 @@ jobs:
3434
- name: Scan code with Trivy
3535
uses: aquasecurity/trivy-action@0.33.1
3636
with:
37-
scan-type: 'fs'
38-
scan-ref: '.'
37+
scan-type: "fs"
38+
scan-ref: "."
3939
exit-code: "1"
4040
ignore-unfixed: true
4141
severity: "CRITICAL,HIGH,MEDIUM"
@@ -66,7 +66,6 @@ jobs:
6666
# uses: actions/checkout@v4
6767
# with:
6868
# submodules: "recursive"
69-
# token: ${{ secrets.PRIVATE_REPO_CLONING_TOKEN }}
7069

7170
# - name: setup flutter
7271
# uses: subosito/flutter-action@v2

.github/workflows/release.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: "Release"
22

33
on:
44
workflow_call:
5-
secrets:
6-
PRIVATE_REPO_CLONING_TOKEN:
7-
description: "Cloning token"
8-
required: true
95

106
jobs:
117
create-release:
@@ -28,12 +24,10 @@ jobs:
2824
files: |
2925
./artifacts/Defguard.ipa
3026
./artifacts/app-release.aab
27+
./artifacts/app-release.apk
3128
3229
create-sbom:
3330
needs: [create-release]
3431
uses: ./.github/workflows/sbom.yaml
3532
with:
3633
upload_url: ${{ needs.create-release.outputs.upload_url }}
37-
secrets:
38-
PRIVATE_REPO_CLONING_TOKEN: ${{ secrets.PRIVATE_REPO_CLONING_TOKEN }}
39-

.github/workflows/sbom-regenerate.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Periodic SBOM Regeneration
2+
permissions:
3+
contents: write
24

35
on:
46
schedule:
5-
- cron: '30 2 * * *' # 2:30 AM UTC
7+
- cron: "30 2 * * *" # 2:30 AM UTC
68

79
jobs:
810
list-releases:
@@ -35,5 +37,4 @@ jobs:
3537
with:
3638
upload_url: ${{ matrix.release.uploadUrl }}
3739
tag: ${{ matrix.release.tagName }}
38-
secrets:
39-
PRIVATE_REPO_CLONING_TOKEN: ${{ secrets.PRIVATE_REPO_CLONING_TOKEN }}
40+
secrets: inherit

.github/workflows/sbom.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ on:
1111
description: "The git tag to generate SBOM for - used in scheduled runs"
1212
required: false
1313
type: string
14-
secrets:
15-
PRIVATE_REPO_CLONING_TOKEN:
16-
description: "Cloning token"
17-
required: true
1814

1915
jobs:
2016
create-sbom:
17+
permissions:
18+
contents: write
2119
runs-on: [self-hosted, Linux, X64]
2220

2321
steps:
@@ -33,27 +31,26 @@ jobs:
3331
- name: Checkout
3432
uses: actions/checkout@v4
3533
with:
36-
submodules: recursive
3734
ref: ${{ steps.vars.outputs.TAG_NAME }}
38-
token: ${{ secrets.PRIVATE_REPO_CLONING_TOKEN }}
35+
submodules: recursive
3936

4037
- name: Create SBOM with Trivy
4138
uses: aquasecurity/trivy-action@0.33.1
4239
with:
43-
scan-type: 'fs'
44-
format: 'spdx-json'
40+
scan-type: "fs"
41+
format: "spdx-json"
4542
output: "defguard-mobile-${{ steps.vars.outputs.VERSION }}.sbom.json"
46-
scan-ref: '.'
43+
scan-ref: "."
4744
severity: "CRITICAL,HIGH,MEDIUM,LOW"
4845
scanners: "vuln"
4946

5047
- name: Create security advisory file with Trivy
5148
uses: aquasecurity/trivy-action@0.33.1
5249
with:
53-
scan-type: 'fs'
54-
format: 'json'
50+
scan-type: "fs"
51+
format: "json"
5552
output: "defguard-mobile-${{ steps.vars.outputs.VERSION }}.advisories.json"
56-
scan-ref: '.'
53+
scan-ref: "."
5754
severity: "CRITICAL,HIGH,MEDIUM,LOW"
5855
scanners: "vuln"
5956

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.envrc
2+
.direnv/

0 commit comments

Comments
 (0)