Skip to content

Commit

Permalink
fully inject variables only
Browse files Browse the repository at this point in the history
  • Loading branch information
Acocalypso committed Dec 11, 2023
1 parent 6b75223 commit 2fbeada
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ jobs:

- name: Extract versionName from gradle.properties
id: extract_version
run: echo "::set-output name=version::$(grep 'reactmap.versionName' gradle.properties | cut -d'=' -f2 | tr -d '[:space:]')"
run: echo "VERSION_NAME=$(grep 'reactmap.versionName' gradle.properties | cut -d'=' -f2 | tr -d '[:space:]')" >> $GITHUB_ENV

- name: Set Package Name
run: echo "PACKAGE_NAME=${{ secrets.PACKAGE_NAME || 'be.mygod.reactmap' }}" >> $GITHUB_ENV

- name: Sign APK and create release
run: |
cd /home/runner/work/reactmap-android/reactmap-android/
./gradlew assembleRelease -Pandroid.injected.signing.store.file=/home/runner/work/reactmap-android/reactmap-android/keystore.jks -Pandroid.injected.signing.store.password=${{ secrets.KEYSTORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.KEY_PASSWORD }} -Preactmap.defaultHost=${{ secrets.MAP_URL }}
./gradlew assembleRelease -Pandroid.injected.signing.store.file=/home/runner/work/reactmap-android/reactmap-android/keystore.jks -Pandroid.injected.signing.store.password=${{ secrets.KEYSTORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.KEY_PASSWORD }} -Preactmap.defaultHost=${{ secrets.MAP_URL }} -Preactmap.packageName=${{ env.PACKAGE_NAME }}
- name: List APK directory - apk
run: ls -R /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/
Expand All @@ -87,33 +90,22 @@ jobs:
name: Reactmap-android
path: /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/release/app-release.apk

# - name: Create GitHub Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ steps.extract_version.outputs.version }}
# release_name: v${{ steps.extract_version.outputs.version }}
# draft: false
# prerelease: false

- name: Rename Artifact
run: mv /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/release/app-release.apk /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/release/${{ secrets.APP_NAME }}-v${{ steps.extract_version.outputs.version }}.apk
run: mv /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/release/app-release.apk /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/release/${{ secrets.APP_NAME }}-v${{ env.VERSION_NAME }}.apk


- name: Release with ncipollo/release-action
uses: ncipollo/release-action@v1
with:
artifacts: /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/release/${{ secrets.APP_NAME }}-v${{ steps.extract_version.outputs.version }}.apk
artifacts: /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/release/${{ secrets.APP_NAME }}-v$${{ env.VERSION_NAME }}.apk
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
skipIfReleaseExists: true
tag: v${{ steps.extract_version.outputs.version }}

- name: Send Discord webhook notification
run: |
release_url="https://github.com/${{ github.repository }}/releases/tag/v${{ steps.extract_version.outputs.version }}"
curl -H "Content-Type: application/json" -X POST -d "{\"content\": \"New release v${{ steps.extract_version.outputs.version }} is available! [View Release]($release_url)\"}" ${{ secrets.DISCORD_WEBHOOK_URL }}
release_url="https://github.com/${{ github.repository }}/releases/tag/v${{ env.VERSION_NAME }}"
curl -H "Content-Type: application/json" -X POST -d "{\"content\": \"New release v${{ env.VERSION_NAME }} is available! [View Release]($release_url)\"}" ${{ secrets.DISCORD_WEBHOOK_URL }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}

0 comments on commit 2fbeada

Please sign in to comment.