-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI for release workflow #2 from PatilShreyas/setup-ci
Add CI for release workflow
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
publish: | ||
name: Release Simple Library | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Set up JDK 12 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 12 | ||
|
||
- name: Cache Gradle and wrapper | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Grant Permission for Gradlew to Execute | ||
run: chmod +x gradlew | ||
|
||
- name: Build AAR ⚙️🛠 | ||
run: bash ./gradlew :simplelibrary:assemble | ||
|
||
- name: Publish to GitHub Package Registry 🚀 | ||
run: bash ./gradlew :simplelibrary:publish | ||
env: | ||
GPR_USER: ${{ GITHUB_ACTOR }} | ||
GPR_KEY: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Release ✅ | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
|
||
- name: Upload Simple Library AAR 🗳 | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: simplelibrary/build/outputs/aar/simplelibrary-release.aar | ||
asset_name: simple-library.aar | ||
asset_content_type: application/aar |