Skip to content

Commit

Permalink
Merge pull request #65 from hannesa2/ReleaseJob
Browse files Browse the repository at this point in the history
Release Job
  • Loading branch information
hannesa2 authored Feb 22, 2021
2 parents 043f648 + 4c3ec8d commit 49807d7
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/Android-CI-Espresso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.0
- name: Build project
run: ./gradlew build
run: ./gradlew assemble
- name: Run tests
run: ./gradlew test
- name: Checks
Expand All @@ -42,10 +42,6 @@ jobs:
matrix:
java_version: [1.8]
steps:
# In order to have sha256sum on macOS, we need to install coreutils first
# Use this until coreutils or sha256sum are natively included in macOS on actions https://github.com/actions/virtual-environments/issues/90
- name: Install coreutils for macOS
run: brew install coreutils
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK ${{ matrix.java_version }}
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/Android-CI-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build:
name: Publish aar
runs-on: macOS-latest
strategy:
matrix:
java_version: [ 11.0.3 ]
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- name: Show tags
run: git tag -n
- name: Install JDK ${{ matrix.java_version }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java_version }}
- name: Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.0
- name: Build project
run: ./gradlew clean assembleRelease
env:
TAG_VERSION: ${{ github.ref }}
- name: Search for aar file
run: echo "AAR_RELASE_FILE=$(find . -name *release.aar | head -n 1)" >> $GITHUB_ENV
- name: Search for AAR release name
run: echo "AAR_RELASE_NAME=$(find . -name *release.aar | head -n 1 | xargs basename)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
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: ${{ env.AAR_RELASE_FILE }}
asset_name: ${{ env.AAR_RELASE_NAME }}
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.github.AppDevNext.Logcat:LogcatCore:2.2.2'
implementation 'com.github.AppDevNext.Logcat:LogcatCore:2.4.0'

implementation project(':library')
implementation 'androidx.core:core-ktx:1.3.2'
Expand Down

0 comments on commit 49807d7

Please sign in to comment.