Skip to content

πŸ† Release 0.0.4 #15

πŸ† Release 0.0.4

πŸ† Release 0.0.4 #15

Workflow file for this run

name: Android
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
ci:
runs-on: ubuntu-latest
steps:
# Setting up project
- uses: actions/checkout@v4
- name: set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Build project
- name: Build with Gradle
run: ./gradlew build
# Test project
- name: Test with Gradle
run: ./gradlew test
# Artifact for later usage
- name: APK Artifact
uses: actions/upload-artifact@v4
with:
name: "Build"
path: app/build/outputs/apk/*
cd:
permissions: write-all
runs-on: ubuntu-latest
needs: [ci]
steps:
# Grab source code
- uses: actions/checkout@v4
# Making the release
- name: Extract version nmae
run: echo APP_VERSION=$(grep "versionName" app/build.gradle.kts | sed -e 's/^.* = "\([0-9.]\+\)"/\1/g') >> "$GITHUB_ENV"
- name: Publish to Github
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.APP_VERSION }}
release_name: Alpha Release ${{ env.APP_VERSION }}
body_path: ./docs/CHANGELOG.md
draft: false
prerelease: true
# Grabing build
- name: Grab Build
uses: actions/download-artifact@v4
with:
name: "Build"
path: build
# Upload APK to github release
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build/release/app-release-unsigned.apk
asset_name: CallGuard.apk
asset_content_type: application/vnd.android.package-archive