Skip to content

Commit 2352974

Browse files
committed
Update github actions (based on SDMSE) and use pinning
1 parent e216fbf commit 2352974

File tree

5 files changed

+112
-54
lines changed

5 files changed

+112
-54
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Common project setup'
2+
description: 'Setup the base project'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set up JDK 17
7+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 #v4.7.0
8+
with:
9+
java-version: '17'
10+
distribution: 'temurin'
11+
12+
- name: Grant execute permission for gradlew
13+
shell: bash
14+
run: chmod +x gradlew
15+
16+
- name: Cache Gradle Wrapper
17+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
18+
with:
19+
path: |
20+
~/.gradle/wrapper
21+
!~/.gradle/wrapper/dists/**/gradle*.zip
22+
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}
23+
restore-keys: |
24+
${{ runner.os }}-gradle-wrapper-
25+
26+
- name: Cache Gradle Dependencies
27+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
28+
with:
29+
path: |
30+
~/.gradle/caches
31+
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'buildSrc/**/*.kt') }}
32+
restore-keys: |
33+
${{ runner.os }}-gradle-caches-
34+
35+
- name: Cache Android Global Build-Cache
36+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
37+
with:
38+
path: |
39+
~/.android/build-cache
40+
key: ${{ runner.os }}-android-build-cache-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
41+
restore-keys: |
42+
${{ runner.os }}-android-build-cache-

.github/release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- changelog-ignore
5+
categories:
6+
- title: ":rocket: Enhancements"
7+
labels:
8+
- enhancement
9+
- title: ":lady_beetle: Bug fixes"
10+
labels:
11+
- bug
12+
- title: ":shrug: Other changes"
13+
labels:
14+
- "*"

.github/workflows/code-checks.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,55 @@ on:
77
branches: [ main ]
88

99
jobs:
10+
lint-vital:
11+
name: Lint vitals
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
flavor: [ Foss,Gplay ]
16+
variant: [ Beta,Release ]
17+
module: [ app ]
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Checkout source code
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
22+
- name: Setup project and build environment
23+
uses: ./.github/actions/common-setup
24+
25+
- name: Check for fatal lint issues
26+
run: ./gradlew lintVital${{ matrix.flavor }}${{ matrix.variant }}
27+
1028
build-modules:
1129
name: Build apps
1230
strategy:
1331
fail-fast: false
1432
matrix:
1533
flavor: [ Foss,Gplay ]
1634
variant: [ Debug ]
17-
module: [ app,app-wear ]
18-
runs-on: ubuntu-latest
35+
module: [ app ]
36+
runs-on: ubuntu-22.04
1937
steps:
20-
- uses: actions/checkout@v3
21-
- name: Set up JDK 17
22-
uses: actions/setup-java@v3
23-
with:
24-
java-version: '17'
25-
distribution: 'adopt'
26-
cache: gradle
27-
- name: Grant execute permission for gradlew
28-
run: chmod +x gradlew
38+
- name: Checkout source code
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
40+
- name: Setup project and build environment
41+
uses: ./.github/actions/common-setup
2942

30-
- name: Build module
43+
- name: Build modules
3144
run: ./gradlew ${{ matrix.module }}:assemble${{ matrix.flavor }}${{ matrix.variant }}
3245

3346
test-modules:
3447
name: Unit tests
3548
strategy:
3649
fail-fast: false
3750
matrix:
38-
variant: [ Release ]
39-
flavor: [ testFoss,testGplay ]
40-
runs-on: ubuntu-latest
51+
variant: [ Debug,Beta,Release ]
52+
flavor: [ test,testFoss,testGplay ]
53+
runs-on: ubuntu-22.04
4154
steps:
42-
- uses: actions/checkout@v3
43-
- name: Set up JDK 17
44-
uses: actions/setup-java@v3
45-
with:
46-
java-version: '17'
47-
distribution: 'adopt'
48-
cache: gradle
49-
- name: Grant execute permission for gradlew
50-
run: chmod +x gradlew
55+
- name: Checkout source code
56+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
57+
- name: Setup project and build environment
58+
uses: ./.github/actions/common-setup
5159

5260
- name: Test modules
5361
run: ./gradlew ${{ matrix.flavor }}${{ matrix.variant }}UnitTest

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
validation:
1313
name: "Validation"
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
steps:
16-
- uses: actions/checkout@v2
17-
- uses: gradle/wrapper-validation-action@v1
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
17+
- uses: gradle/actions/wrapper-validation@06832c7b30a0129d7fb559bcc6e43d26f6374244 #v4.3.1

.github/workflows/release-tag.yml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ on:
88
jobs:
99
release-github:
1010
name: Create GitHub release
11-
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
runs-on: ubuntu-22.04
1214
environment: foss-production
1315
steps:
1416
- name: Decode Keystore
@@ -21,25 +23,22 @@ jobs:
2123
echo $ENCODED_KEYSTORE | base64 -di > "${TMP_KEYSTORE_FILE_PATH}"
2224
echo "STORE_PATH=$(echo $TMP_KEYSTORE_FILE_PATH)" >> $GITHUB_ENV
2325
24-
- name: Checkout
25-
uses: actions/checkout@v3
26+
- name: Checkout source code
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
2628
with:
2729
fetch-depth: 0
2830

31+
- name: Setup project and build environment
32+
uses: ./.github/actions/common-setup
33+
2934
- name: Get the version
3035
id: tagger
31-
uses: jimschubert/query-tag-action@v2
36+
uses: jimschubert/query-tag-action@0b288a5fff630fea2e96d61b99047ed823ca19dc #v2.2
3237
with:
3338
skip-unshallow: 'true'
3439
abbrev: false
3540
commit-ish: HEAD
3641

37-
- name: Install JDK ${{ matrix.java_version }}
38-
uses: actions/setup-java@v3
39-
with:
40-
distribution: 'adopt'
41-
java-version: 17
42-
4342
- name: Assemble beta APK
4443
if: contains(steps.tagger.outputs.tag, '-beta')
4544
run: ./gradlew assembleFossBeta
@@ -60,7 +59,7 @@ jobs:
6059

6160
- name: Create pre-release
6261
if: contains(steps.tagger.outputs.tag, '-beta')
63-
uses: softprops/action-gh-release@v1
62+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda #v2.2.1
6463
with:
6564
prerelease: true
6665
tag_name: ${{ steps.tagger.outputs.tag }}
@@ -74,21 +73,19 @@ jobs:
7473

7574
- name: Create release
7675
if: "!contains(steps.tagger.outputs.tag, '-beta')"
77-
uses: softprops/action-gh-release@v1
76+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda #v2.2.1
7877
with:
7978
prerelease: false
8079
tag_name: ${{ steps.tagger.outputs.tag }}
8180
name: ${{ steps.tagger.outputs.tag }}
8281
generate_release_notes: true
83-
files: |
84-
app/build/outputs/apk/foss/release/*.apk
85-
app-wear/build/outputs/apk/foss/release/*.apk
82+
files: app/build/outputs/apk/foss/release/*.apk
8683
env:
8784
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8885

8986
release-gplay:
9087
name: Create Google Play release
91-
runs-on: ubuntu-latest
88+
runs-on: ubuntu-22.04
9289
environment: gplay-production
9390
steps:
9491
- name: Decode Keystore
@@ -111,29 +108,26 @@ jobs:
111108
echo $ENCODED_SERVICE_KEY | base64 -di > "${TMP_SERVICEKEY_FILE_PATH}"
112109
echo "SUPPLY_JSON_KEY=$(echo $TMP_SERVICEKEY_FILE_PATH)" >> $GITHUB_ENV
113110
114-
- name: Checkout
115-
uses: actions/checkout@v3
111+
- name: Checkout source code
112+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
116113
with:
117114
fetch-depth: 0
118115

116+
- name: Setup project and build environment
117+
uses: ./.github/actions/common-setup
118+
119119
- name: Get the version
120120
id: tagger
121-
uses: jimschubert/query-tag-action@v2
121+
uses: jimschubert/query-tag-action@0b288a5fff630fea2e96d61b99047ed823ca19dc #v2.2
122122
with:
123123
skip-unshallow: 'true'
124124
abbrev: false
125125
commit-ish: HEAD
126126

127-
- name: Install JDK ${{ matrix.java_version }}
128-
uses: actions/setup-java@v3
129-
with:
130-
distribution: 'adopt'
131-
java-version: 17
132-
133127
- name: Set up ruby env
134-
uses: ruby/setup-ruby@v1
128+
uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 #v1.229.0
135129
with:
136-
ruby-version: 2.7.6
130+
ruby-version: 3.3.6
137131
bundler-cache: true
138132

139133
# - name: Assemble WearOS beta and upload to Google Play

0 commit comments

Comments
 (0)