Skip to content

Commit

Permalink
Add debug and create-release workflows, Remove apk workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kairusds committed Dec 27, 2021
1 parent 73d1a04 commit 3e85dcf
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 27 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Create Debug Release

on: workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: 11

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Create debug build
uses: gradle/gradle-build-action@v2
with:
arguments: build

- name: Set environment variables
run: |
echo "APK_PATH=$(find app/build/outputs/apk/debug/*.apk)" >> $GITHUB_ENV
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
sha=`sha256sum ${{ env.APK_PATH }} | awk '{ print $1 }'`
echo "APK_SHA256=$sha" >> $GITHUB_ENV
- name: Get apk info
id: apk-info
uses: hkusu/apk-info-action@v1
with:
apk-path: ${{ env.APK_PATH }}

- name: Upload binaries to a release
uses: softprops/action-gh-release@v1
with:
body: |
Commit hash: ${{ env.COMMIT_HASH }}
APK SHA-256 Checksum: ${{ env.APK_SHA256 }}
files: ${{ env.APK_PATH }}
tag_name: ${{ steps.apk-info.outputs.version-name }}

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: LADB
path: ${{ env.APK_PATH }}
49 changes: 22 additions & 27 deletions .github/workflows/apk.yml → .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
name: Android CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleDebug
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ladb
path: app/build/outputs/apk/
name: Android CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleDebug

0 comments on commit 3e85dcf

Please sign in to comment.