Skip to content

Commit bb280f3

Browse files
committed
Fix setup-java step in release GH action
1 parent f0339d6 commit bb280f3

File tree

2 files changed

+141
-139
lines changed

2 files changed

+141
-139
lines changed

.github/workflows/beta.yml

Lines changed: 60 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,62 +14,63 @@ jobs:
1414
name: Create GH release and promote Play store internal to Beta
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
18-
- name: Create release
19-
id: create_release
20-
uses: actions/create-release@v1
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
with:
24-
tag_name: ${{ github.ref }}
25-
body_path: ./CHANGELOG.md
26-
release_name: ${{ github.ref }}
27-
draft: true
28-
prerelease: true
29-
- name: set up JDK 11
30-
uses: actions/setup-java@v3
31-
with:
32-
java-version: 11
33-
- uses: actions/cache@v3
34-
with:
35-
path: |
36-
~/.gradle/caches
37-
~/.gradle/wrapper
38-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
39-
restore-keys: |
40-
${{ runner.os }}-gradle-
41-
- name: Decrypt secrets
42-
env:
43-
GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS }}
44-
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
45-
run: |
46-
echo -n $GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS > project/app/owntracks-android-gcloud-creds.json
47-
echo -n $KEYSTORE_BASE64 | base64 -d > project/owntracks.release.keystore.jks
48-
- name: Build APK
49-
run: ./gradlew clean :app:getLatestVersionCodeMinusOne assembleRelease
50-
working-directory: project
51-
env:
52-
KEYSTORE_PASSPHRASE: ${{ secrets.KEYSTORE_PASSPHRASE }}
53-
ORG_GRADLE_PROJECT_google_maps_api_key: ${{ secrets.GOOGLE_MAPS_API_KEY }}
54-
MAKE_APK_SAME_VERSION_CODE_AS_GOOGLE_PLAY: yes
55-
- name: Upload GMS Release Asset
56-
uses: actions/upload-release-asset@v1
57-
env:
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59-
with:
60-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
61-
asset_path: ./project/app/build/outputs/apk/gms/release/app-gms-release.apk
62-
asset_name: owntracks-release-gms.apk
63-
asset_content_type: application/vnd.android.package-archive
64-
- name: Upload OSS Release Asset
65-
uses: actions/upload-release-asset@v1
66-
env:
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
with:
69-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
70-
asset_path: ./project/app/build/outputs/apk/oss/release/app-oss-release.apk
71-
asset_name: owntracks-release-oss.apk
72-
asset_content_type: application/vnd.android.package-archive
73-
- name: Promote play store beta from internal
74-
run: ./gradlew promoteArtifact --from-track internal --promote-track beta --release-status completed
75-
working-directory: project
17+
- uses: actions/checkout@v3
18+
- name: Create release
19+
id: create_release
20+
uses: actions/create-release@v1
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
tag_name: ${{ github.ref }}
25+
body_path: ./CHANGELOG.md
26+
release_name: ${{ github.ref }}
27+
draft: true
28+
prerelease: true
29+
- name: set up JDK 11
30+
uses: actions/setup-java@v3
31+
with:
32+
distribution: "temurin"
33+
java-version: 11
34+
- uses: actions/cache@v3
35+
with:
36+
path: |
37+
~/.gradle/caches
38+
~/.gradle/wrapper
39+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
40+
restore-keys: |
41+
${{ runner.os }}-gradle-
42+
- name: Decrypt secrets
43+
env:
44+
GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS }}
45+
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
46+
run: |
47+
echo -n $GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS > project/app/owntracks-android-gcloud-creds.json
48+
echo -n $KEYSTORE_BASE64 | base64 -d > project/owntracks.release.keystore.jks
49+
- name: Build APK
50+
run: ./gradlew clean :app:getLatestVersionCodeMinusOne assembleRelease
51+
working-directory: project
52+
env:
53+
KEYSTORE_PASSPHRASE: ${{ secrets.KEYSTORE_PASSPHRASE }}
54+
ORG_GRADLE_PROJECT_google_maps_api_key: ${{ secrets.GOOGLE_MAPS_API_KEY }}
55+
MAKE_APK_SAME_VERSION_CODE_AS_GOOGLE_PLAY: yes
56+
- name: Upload GMS Release Asset
57+
uses: actions/upload-release-asset@v1
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
62+
asset_path: ./project/app/build/outputs/apk/gms/release/app-gms-release.apk
63+
asset_name: owntracks-release-gms.apk
64+
asset_content_type: application/vnd.android.package-archive
65+
- name: Upload OSS Release Asset
66+
uses: actions/upload-release-asset@v1
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
71+
asset_path: ./project/app/build/outputs/apk/oss/release/app-oss-release.apk
72+
asset_name: owntracks-release-oss.apk
73+
asset_content_type: application/vnd.android.package-archive
74+
- name: Promote play store beta from internal
75+
run: ./gradlew promoteArtifact --from-track internal --promote-track beta --release-status completed
76+
working-directory: project

.github/workflows/release.yml

Lines changed: 81 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -12,83 +12,84 @@ jobs:
1212
name: Create GH release and promote Play store beta to release
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: octokit/request-action@v2.x
17-
name: Find beta tags
18-
id: get_beta_tags
19-
with:
20-
route: GET /repos/owntracks/android/git/matching-refs/tags/${{ github.ref }}-beta
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
- name: Get number of matching tags
24-
id: tagCount
25-
env:
26-
labels: ${{ steps.get_beta_tags.outputs.data }}
27-
run: |
28-
echo $labels
29-
export LENGTH=$(echo $labels | jq '. | length')
30-
echo $LENGTH
31-
echo "::set-output name=beta_tag_count::$LENGTH"
32-
- name: Create release
33-
id: create_release
34-
uses: actions/create-release@v1
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
with:
38-
tag_name: ${{ github.ref }}
39-
body_path: ./CHANGELOG.md
40-
release_name: ${{ github.ref }}
41-
draft: true
42-
prerelease: false
43-
- name: set up JDK 11
44-
uses: actions/setup-java@v3
45-
with:
46-
java-version: 11
47-
- uses: actions/cache@v3
48-
with:
49-
path: |
50-
~/.gradle/caches
51-
~/.gradle/wrapper
52-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
53-
restore-keys: |
54-
${{ runner.os }}-gradle-
55-
- name: Decrypt secrets
56-
env:
57-
GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS }}
58-
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
59-
run: |
60-
echo -n $GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS > project/app/owntracks-android-gcloud-creds.json
61-
echo -n $KEYSTORE_BASE64 | base64 -d > project/owntracks.release.keystore.jks
62-
- name: Build APK
63-
run: ./gradlew clean :app:getLatestVersionCodeMinusOne assembleRelease
64-
working-directory: project
65-
env:
66-
KEYSTORE_PASSPHRASE: ${{ secrets.KEYSTORE_PASSPHRASE }}
67-
ORG_GRADLE_PROJECT_google_maps_api_key: ${{ secrets.GOOGLE_MAPS_API_KEY }}
68-
MAKE_APK_SAME_VERSION_CODE_AS_GOOGLE_PLAY: yes
69-
- name: Upload GMS Release Asset
70-
uses: actions/upload-release-asset@v1
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73-
with:
74-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
75-
asset_path: ./project/app/build/outputs/apk/gms/release/app-gms-release.apk
76-
asset_name: owntracks-release-gms.apk
77-
asset_content_type: application/vnd.android.package-archive
78-
- name: Upload OSS Release Asset
79-
uses: actions/upload-release-asset@v1
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
with:
83-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
84-
asset_path: ./project/app/build/outputs/apk/oss/release/app-oss-release.apk
85-
asset_name: owntracks-release-oss.apk
86-
asset_content_type: application/vnd.android.package-archive
87-
- name: Promote play store production from beta
88-
run: ./gradlew promoteArtifact --from-track beta --promote-track production --release-status completed
89-
working-directory: project
90-
if: ${{ steps.tagCount.outputs.beta_tag_count > 0 }}
91-
- name: Promote play store production from internal
92-
run: ./gradlew promoteArtifact --from-track internal --promote-track production --release-status completed
93-
working-directory: project
94-
if: ${{ steps.tagCount.outputs.beta_tag_count == 0 }}
15+
- uses: actions/checkout@v3
16+
- uses: octokit/request-action@v2.x
17+
name: Find beta tags
18+
id: get_beta_tags
19+
with:
20+
route: GET /repos/owntracks/android/git/matching-refs/tags/${{ github.ref }}-beta
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Get number of matching tags
24+
id: tagCount
25+
env:
26+
labels: ${{ steps.get_beta_tags.outputs.data }}
27+
run: |
28+
echo $labels
29+
export LENGTH=$(echo $labels | jq '. | length')
30+
echo $LENGTH
31+
echo "::set-output name=beta_tag_count::$LENGTH"
32+
- name: Create release
33+
id: create_release
34+
uses: actions/create-release@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
tag_name: ${{ github.ref }}
39+
body_path: ./CHANGELOG.md
40+
release_name: ${{ github.ref }}
41+
draft: true
42+
prerelease: false
43+
- name: set up JDK 11
44+
uses: actions/setup-java@v3
45+
with:
46+
java-version: 11
47+
distribution: "temurin"
48+
- uses: actions/cache@v3
49+
with:
50+
path: |
51+
~/.gradle/caches
52+
~/.gradle/wrapper
53+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
54+
restore-keys: |
55+
${{ runner.os }}-gradle-
56+
- name: Decrypt secrets
57+
env:
58+
GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS }}
59+
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
60+
run: |
61+
echo -n $GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS > project/app/owntracks-android-gcloud-creds.json
62+
echo -n $KEYSTORE_BASE64 | base64 -d > project/owntracks.release.keystore.jks
63+
- name: Build APK
64+
run: ./gradlew clean :app:getLatestVersionCodeMinusOne assembleRelease
65+
working-directory: project
66+
env:
67+
KEYSTORE_PASSPHRASE: ${{ secrets.KEYSTORE_PASSPHRASE }}
68+
ORG_GRADLE_PROJECT_google_maps_api_key: ${{ secrets.GOOGLE_MAPS_API_KEY }}
69+
MAKE_APK_SAME_VERSION_CODE_AS_GOOGLE_PLAY: yes
70+
- name: Upload GMS Release Asset
71+
uses: actions/upload-release-asset@v1
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
with:
75+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
76+
asset_path: ./project/app/build/outputs/apk/gms/release/app-gms-release.apk
77+
asset_name: owntracks-release-gms.apk
78+
asset_content_type: application/vnd.android.package-archive
79+
- name: Upload OSS Release Asset
80+
uses: actions/upload-release-asset@v1
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
with:
84+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
85+
asset_path: ./project/app/build/outputs/apk/oss/release/app-oss-release.apk
86+
asset_name: owntracks-release-oss.apk
87+
asset_content_type: application/vnd.android.package-archive
88+
- name: Promote play store production from beta
89+
run: ./gradlew promoteArtifact --from-track beta --promote-track production --release-status completed
90+
working-directory: project
91+
if: ${{ steps.tagCount.outputs.beta_tag_count > 0 }}
92+
- name: Promote play store production from internal
93+
run: ./gradlew promoteArtifact --from-track internal --promote-track production --release-status completed
94+
working-directory: project
95+
if: ${{ steps.tagCount.outputs.beta_tag_count == 0 }}

0 commit comments

Comments
 (0)