name : Release Automation
on :
push :
tags :
- '*'
create :
jobs :
release-automation :
name : Create Release
runs-on : ubuntu-latest
if : "contains(toJSON(github.event.ref_type), 'tag') && contains(toJSON(github.event.ref), 'iceraven')"
steps :
- name : Checkout repository
uses : actions/checkout@v2
with :
fetch-depth : 0
- name : Setup Java
uses : actions/setup-java@v1
with :
java-version : 11
- name : Install Android SDK with pieces Gradle skips
run : ./automation/iceraven/install-sdk.sh
- name : Inspect memory
run : free -m
- name : Build forkRelease variant of app
uses : eskatos/gradle-command-action@v1
env :
# Try to stop the daemon from magically vanishing by adding random memory-related arguments.
# See <https://stackoverflow.com/a/70010526> and <https://stackoverflow.com/a/70756876>
GRADLE_OPTS : --stacktrace -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=1g -Xms4096m -Xmx8192m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/dev/stderr"
with :
wrapper-cache-enabled : true
dependencies-cache-enabled : true
configuration-cache-enabled : true
arguments : app:assembleForkRelease -PversionName=${{ github.event.ref }}
- name : Create signed APKs
uses : abhijitvalluri/sign-apks@v0.8
with :
releaseDirectory : app/build/outputs/apk/forkRelease/
signingKeyBase64 : ${{ secrets.DEBUG_SIGNING_KEY }}
alias : ${{ secrets.DEBUG_ALIAS }}
keyStorePassword : ${{ secrets.DEBUG_KEY_STORE_PASSWORD }}
keyPassword : ${{ secrets.DEBUG_KEY_PASSWORD }}
- name : Create changelog
run : |
PREVIOUS_RELEASE_TAG=$(git tag --list iceraven-* --sort=-creatordate | tail -n+2 | head -n 1)
echo "## Automated release of version ${{ github.event.ref }} browser" >>temp_changelog.md
if [[ "$(git log | grep $PREVIOUS_RELEASE_TAG | wc -l)" != "0" ]] ; then
# There's a path from the previous release to now
echo "<details>" >>temp_changelog.md
echo "<summary>Click to expand</summary>" >>temp_changelog.md
echo " " >>temp_changelog.md
echo "This is an automated release, consisting of the following changes:" >>temp_changelog.md
echo "### Change log (commit history since previous release)" >>temp_changelog.md
echo " " >>temp_changelog.md
git log ${{ github.event.ref }}...$PREVIOUS_RELEASE_TAG --pretty='format:%C(auto)%h (%as) %s' | head -n 1000 >>temp_changelog.md
echo " " >>temp_changelog.md
echo " " >>temp_changelog.md
echo "</details>" >>temp_changelog.md
else
echo "This is an automated release, not directly descended from the previous release." >>temp_changelog.md
fi
echo "**NOTE**: @fork-maintainers, you can edit these auto-generated release notes with a more user-friendly summary of the key changes, if needed." >>temp_changelog.md
echo " " >>temp_changelog.md
- name : Create Release
id : create_release
uses : actions/create-release@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
tag_name : ${{ github.event.ref }}
release_name : "Version ${{ github.event.ref }}"
draft : false
prerelease : false
body_path : temp_changelog.md
- name : Upload arm64 apk
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
upload_url : ${{ steps.create_release.outputs.upload_url }}
asset_path : app/build/outputs/apk/forkRelease/app-arm64-v8a-forkRelease.apk
asset_name : ${{ github.event.ref }}-browser-arm64-v8a-forkRelease.apk
asset_content_type : application/vnd.android.package-archive
- name : Upload armeabi apk
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
upload_url : ${{ steps.create_release.outputs.upload_url }}
asset_path : app/build/outputs/apk/forkRelease/app-armeabi-v7a-forkRelease.apk
asset_name : ${{ github.event.ref }}-browser-armeabi-v7a-forkRelease.apk
asset_content_type : application/vnd.android.package-archive
- name : Upload x86 apk
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
upload_url : ${{ steps.create_release.outputs.upload_url }}
asset_path : app/build/outputs/apk/forkRelease/app-x86-forkRelease.apk
asset_name : ${{ github.event.ref }}-browser-x86-forkRelease.apk
asset_content_type : application/vnd.android.package-archive
- name : Upload x86_64 apk
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
upload_url : ${{ steps.create_release.outputs.upload_url }}
asset_path : app/build/outputs/apk/forkRelease/app-x86_64-forkRelease.apk
asset_name : ${{ github.event.ref }}-browser-x86_64-forkRelease.apk
asset_content_type : application/vnd.android.package-archive