2021-08-03 13:56:56 +02:00
|
|
|
name: Android Build Release Workflow
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-08-17 06:41:51 +02:00
|
|
|
#branches: [ dev ]
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
2021-08-03 13:56:56 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: gradle/wrapper-validation-action@v1
|
|
|
|
|
|
|
|
- name: create and checkout branch
|
|
|
|
# push events already checked out the branch
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: git checkout -B ${{ github.head_ref }}
|
|
|
|
|
|
|
|
#- name: restoreReleaseKeystore
|
|
|
|
# run: |
|
|
|
|
# echo "${{ secrets.RELEASE_KEYSTORE }}" -d -o release.keystore release.keystore.asc
|
|
|
|
# gpg --batch --passphrase "${{ secrets.RELEASE_KEYSTORE_GPG }}" -d -o release.keystore release.keystore.asc
|
|
|
|
|
2022-02-28 00:09:47 +01:00
|
|
|
- name: generate ChangeLog
|
|
|
|
run: |
|
|
|
|
git show --no-patch HEAD --format='%B' > customChangeLogFile
|
2021-10-12 15:35:59 +02:00
|
|
|
- name: set up JDK 11
|
2021-08-03 13:56:56 +02:00
|
|
|
uses: actions/setup-java@v2
|
|
|
|
with:
|
2021-10-12 15:35:59 +02:00
|
|
|
java-version: 11
|
|
|
|
distribution: "temurin"
|
2021-08-03 13:56:56 +02:00
|
|
|
|
|
|
|
- name: Cache Gradle dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle
|
|
|
|
|
|
|
|
- name: Build Project
|
|
|
|
run: ./gradlew assemble
|
|
|
|
|
|
|
|
- name: build release
|
|
|
|
run: ./gradlew assembleRelease
|
|
|
|
|
|
|
|
- name: Sign app APK
|
|
|
|
uses: r0adkll/sign-android-release@v1
|
|
|
|
# ID used to access action output
|
|
|
|
id: sign_app
|
|
|
|
with:
|
|
|
|
releaseDirectory: app/build/outputs/apk/brave/release
|
|
|
|
signingKeyBase64: ${{ secrets.RELEASE_KEYSTORE }}
|
|
|
|
#alias: ${{ secrets.ALIAS }}
|
|
|
|
alias: alias_name
|
|
|
|
keyStorePassword: ${{ secrets.RELEASE_KEYSTORE_PASS }}
|
|
|
|
#keyPassword: ${{ secrets.RELEASE_KEYSTORE_PASS }}
|
|
|
|
|
|
|
|
- name: Upload APK
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: app
|
|
|
|
path: ${{steps.sign_app.outputs.signedReleaseFile}}
|
|
|
|
#path: app/build/outputs/apk/brave/release/*.apk
|
2022-02-28 00:09:47 +01:00
|
|
|
# evermind: How to get just the tag name? -> https://github.community/t/how-to-get-just-the-tag-name/16241/11
|
|
|
|
- name: Branch name
|
|
|
|
id: branch_name
|
|
|
|
run: |
|
|
|
|
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
|
|
|
|
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
|
|
|
|
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
|
|
|
|
# evermind
|
|
|
|
- name: rename apk and create checksum
|
|
|
|
id: renamed_apk
|
|
|
|
env:
|
|
|
|
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
|
|
|
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
|
|
|
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
|
|
|
SIGNED_APK: ${{ steps.sign_app.outputs.signedReleaseFile }}
|
|
|
|
run: |
|
|
|
|
echo ::set-output name=RENAMED_APK::${SIGNED_APK%/*}/BraveNewPipe_${SOURCE_TAG}.apk
|
|
|
|
cp ${SIGNED_APK} ${SIGNED_APK%/*}/BraveNewPipe_${SOURCE_TAG}.apk
|
|
|
|
cd ${SIGNED_APK%/*}
|
|
|
|
sha256sum BraveNewPipe_${SOURCE_TAG}.apk > BraveNewPipe_${SOURCE_TAG}.apk.sha256
|
|
|
|
cd -
|
|
|
|
# evermind: how to autorelease?: https://github.com/marvinpinto/action-automatic-releases
|
|
|
|
- name: auto release
|
|
|
|
uses: "evermind-zz/action-automatic-releases@v1.2.1-evrmd"
|
|
|
|
with:
|
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
prerelease: false
|
|
|
|
changelog_file: "customChangeLogFile"
|
|
|
|
files: |
|
|
|
|
${{ steps.renamed_apk.outputs.RENAMED_APK }}
|
|
|
|
${{ steps.renamed_apk.outputs.RENAMED_APK }}.sha256
|
|
|
|
id: "automatic_releases"
|
|
|
|
- name: "Automatically update json api data repository"
|
|
|
|
env:
|
|
|
|
GITHUB_SUPER_TOKEN: ${{ secrets.MY_GITHUB_SUPER_TOKEN }}
|
|
|
|
RENAMED_APK: ${{ steps.renamed_apk.outputs.RENAMED_APK }}
|
|
|
|
run: |
|
|
|
|
./.github/scripts/brave-new-pipe-releast-actions.sh "$AUTOMATIC_RELEASES_TAG" "${RENAMED_APK}"
|
|
|
|
|
|
|
|
# evermind - name: pack all app dir
|
|
|
|
# evermind run: tar czpf apper.tgz app
|
|
|
|
# evermind - name: Upload app dir artifact more stuff
|
|
|
|
# evermind uses: actions/upload-artifact@v2
|
|
|
|
# evermind with:
|
|
|
|
# evermind name: appDir
|
|
|
|
# evermind path: apper.tgz
|
2021-08-03 13:56:56 +02:00
|
|
|
#- name: upload artefact to App Center
|
|
|
|
# uses: wzieba/AppCenter-Github-Action@v1
|
|
|
|
# with:
|
|
|
|
# appName: ronakukani/Github-Actions-Demo
|
|
|
|
# token: ${{secrets.APP_CENTER_TOKEN}}
|
|
|
|
# group: Testers
|
|
|
|
# file: app/build/outputs/apk/release/app-release.apk
|
|
|
|
# notifyTesters: true
|
|
|
|
# debug: false
|
|
|
|
# releaseNotes: "here is your release note"
|
|
|
|
|
|
|
|
#- name: Send message to ms teams
|
|
|
|
# uses: dhollerbach/github-action-send-message-to-ms-teams@1.0.10
|
|
|
|
# with:
|
|
|
|
# webhook: 'Here is your Microsoft Teams Webhook URL'
|
|
|
|
# message: 'Here is your message'
|