Workflow file for this run
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
on: | |
push: | |
tags: | |
- anodevpn-*.*.* | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install packages | |
run: sudo apt-get install jq bash curl | |
- uses: actions/checkout@v2 | |
- name: Set env | |
run: echo "RELEASE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Create a release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true | |
automatic_release_tag: ${{ env.RELEASE_NAME }} | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Add Install packages permissions to AndroidManifest | |
run: sed -i 's/<!-- NO INSTALL PACKAGE PERMISSION -->/<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"\/><uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"\/>/' /home/runner/work/AnodeVPN-android/AnodeVPN-android/app/src/main/AndroidManifest.xml | |
# See https://github.com/actions/cache/blob/main/examples.md#java---gradle | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
~/.android/build-cache | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Build with Gradle | |
run: ./gradlew assembleRelease | |
env: | |
CI: 'true' | |
ANODE_CONFIDENTIAL_alias: ${{ secrets.ANODE_CONFIDENTIAL_ALIAS }} | |
ANODE_CONFIDENTIAL_password0: ${{ secrets.ANODE_CONFIDENTIAL_PASSWORD0 }} | |
ANODE_CONFIDENTIAL_password1: ${{ secrets.ANODE_CONFIDENTIAL_PASSWORD1 }} | |
# See https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle#caching-dependencies | |
- name: Clean up Gradle Cache | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -fr ~/.gradle/caches/gc.properties | |
rm -fr ~/.gradle/caches/*/plugin-resolution/ | |
- uses: actions/upload-artifact@main | |
with: | |
name: release apk | |
path: /home/runner/work/AnodeVPN-android/AnodeVPN-android/app/build/outputs/apk/release/app-release.apk | |
- name: Publish release | |
run: /bin/bash -c 'source ./tools/publish.sh' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ANODE_APIKEY: ${{ secrets.ANODE_APIKEY }} |