0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-20 04:12:14 +02:00
UrlChecker/.github/workflows/alpha.yml
dependabot[bot] 5bf88d6dc3 Bump gradle/gradle-build-action from 2 to 3
Bumps [gradle/gradle-build-action](https://github.com/gradle/gradle-build-action) from 2 to 3.
- [Release notes](https://github.com/gradle/gradle-build-action/releases)
- [Commits](https://github.com/gradle/gradle-build-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: gradle/gradle-build-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-28 20:14:46 +01:00

64 lines
1.9 KiB
YAML

# This action builds the alpha version as apk on a password protected zip,
# and uploads it to the alpha release.
# Adapted from https://github.com/amirisback/automated-build-android-app-with-github-action
name: Build alpha apk
on:
# Triggers the workflow on push events for the master branch
# push:
# branches:
# - master
# Run this workflow manually from the Actions tab
workflow_dispatch:
# parameters
env:
VARIANT: alpha
TAG: alpha
ZIP: app-alpha.zip
permissions:
contents: write # need to update tag and release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get the repository files
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set gradlew as executable
# for some reason the gradle-build-action doesn't do this automatically
run: chmod +x ./gradlew
- name: Build & assemble with gradle
uses: gradle/gradle-build-action@v3
with:
arguments: >
build
assemble${{ env.VARIANT }}
- name: Zip ${{ env.VARIANT }} apk as ${{ env.ZIP }}
# just remove the password here if you want to build the apk yourself instead of sponsoring me and getting it as a benefit :(
run: zip -j -P ${{ secrets.ALPHA_PASS }} ${{ env.ZIP }} app/build/outputs/apk/${{ env.VARIANT }}/app-${{ env.VARIANT }}.apk
- name: Update ${{ env.TAG }} tag to current commit
# equivalent to EndBug/latest-tag@latest but simpler
run: |
git tag --force ${{ env.TAG }}
git push --force origin tag ${{ env.TAG }}
- name: Upload ${{ env.ZIP }} to ${{ env.TAG }} release
# equivalent to softprops/action-gh-release@v1 but using official cli
run: |
gh release upload ${{ env.TAG }} ${{ env.ZIP }} --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}