-
-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix setup-java step in release GH action
- Loading branch information
Showing
2 changed files
with
141 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,83 +12,84 @@ jobs: | |
name: Create GH release and promote Play store beta to release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: octokit/[email protected] | ||
name: Find beta tags | ||
id: get_beta_tags | ||
with: | ||
route: GET /repos/owntracks/android/git/matching-refs/tags/${{ github.ref }}-beta | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get number of matching tags | ||
id: tagCount | ||
env: | ||
labels: ${{ steps.get_beta_tags.outputs.data }} | ||
run: | | ||
echo $labels | ||
export LENGTH=$(echo $labels | jq '. | length') | ||
echo $LENGTH | ||
echo "::set-output name=beta_tag_count::$LENGTH" | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
body_path: ./CHANGELOG.md | ||
release_name: ${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
- name: set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 11 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Decrypt secrets | ||
env: | ||
GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS }} | ||
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | ||
run: | | ||
echo -n $GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS > project/app/owntracks-android-gcloud-creds.json | ||
echo -n $KEYSTORE_BASE64 | base64 -d > project/owntracks.release.keystore.jks | ||
- name: Build APK | ||
run: ./gradlew clean :app:getLatestVersionCodeMinusOne assembleRelease | ||
working-directory: project | ||
env: | ||
KEYSTORE_PASSPHRASE: ${{ secrets.KEYSTORE_PASSPHRASE }} | ||
ORG_GRADLE_PROJECT_google_maps_api_key: ${{ secrets.GOOGLE_MAPS_API_KEY }} | ||
MAKE_APK_SAME_VERSION_CODE_AS_GOOGLE_PLAY: yes | ||
- name: Upload GMS Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
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 | ||
asset_path: ./project/app/build/outputs/apk/gms/release/app-gms-release.apk | ||
asset_name: owntracks-release-gms.apk | ||
asset_content_type: application/vnd.android.package-archive | ||
- name: Upload OSS Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
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 | ||
asset_path: ./project/app/build/outputs/apk/oss/release/app-oss-release.apk | ||
asset_name: owntracks-release-oss.apk | ||
asset_content_type: application/vnd.android.package-archive | ||
- name: Promote play store production from beta | ||
run: ./gradlew promoteArtifact --from-track beta --promote-track production --release-status completed | ||
working-directory: project | ||
if: ${{ steps.tagCount.outputs.beta_tag_count > 0 }} | ||
- name: Promote play store production from internal | ||
run: ./gradlew promoteArtifact --from-track internal --promote-track production --release-status completed | ||
working-directory: project | ||
if: ${{ steps.tagCount.outputs.beta_tag_count == 0 }} | ||
- uses: actions/checkout@v3 | ||
- uses: octokit/[email protected] | ||
name: Find beta tags | ||
id: get_beta_tags | ||
with: | ||
route: GET /repos/owntracks/android/git/matching-refs/tags/${{ github.ref }}-beta | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get number of matching tags | ||
id: tagCount | ||
env: | ||
labels: ${{ steps.get_beta_tags.outputs.data }} | ||
run: | | ||
echo $labels | ||
export LENGTH=$(echo $labels | jq '. | length') | ||
echo $LENGTH | ||
echo "::set-output name=beta_tag_count::$LENGTH" | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
body_path: ./CHANGELOG.md | ||
release_name: ${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
- name: set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 11 | ||
distribution: "temurin" | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Decrypt secrets | ||
env: | ||
GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS }} | ||
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | ||
run: | | ||
echo -n $GOOGLE_CLOUD_SERVICE_ACCOUNT_CREDENTIALS > project/app/owntracks-android-gcloud-creds.json | ||
echo -n $KEYSTORE_BASE64 | base64 -d > project/owntracks.release.keystore.jks | ||
- name: Build APK | ||
run: ./gradlew clean :app:getLatestVersionCodeMinusOne assembleRelease | ||
working-directory: project | ||
env: | ||
KEYSTORE_PASSPHRASE: ${{ secrets.KEYSTORE_PASSPHRASE }} | ||
ORG_GRADLE_PROJECT_google_maps_api_key: ${{ secrets.GOOGLE_MAPS_API_KEY }} | ||
MAKE_APK_SAME_VERSION_CODE_AS_GOOGLE_PLAY: yes | ||
- name: Upload GMS Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
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 | ||
asset_path: ./project/app/build/outputs/apk/gms/release/app-gms-release.apk | ||
asset_name: owntracks-release-gms.apk | ||
asset_content_type: application/vnd.android.package-archive | ||
- name: Upload OSS Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
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 | ||
asset_path: ./project/app/build/outputs/apk/oss/release/app-oss-release.apk | ||
asset_name: owntracks-release-oss.apk | ||
asset_content_type: application/vnd.android.package-archive | ||
- name: Promote play store production from beta | ||
run: ./gradlew promoteArtifact --from-track beta --promote-track production --release-status completed | ||
working-directory: project | ||
if: ${{ steps.tagCount.outputs.beta_tag_count > 0 }} | ||
- name: Promote play store production from internal | ||
run: ./gradlew promoteArtifact --from-track internal --promote-track production --release-status completed | ||
working-directory: project | ||
if: ${{ steps.tagCount.outputs.beta_tag_count == 0 }} |