This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automatically build using github actions
- Loading branch information
Showing
2 changed files
with
132 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,88 @@ | ||
name: Build-and-Publish | ||
|
||
on: | ||
# triggers on pushes with tag | ||
push: | ||
tags: | ||
- '*.*' | ||
|
||
jobs: | ||
# build the apk for release | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# check out repo with submodules | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: senpai | ||
submodules: recursive | ||
|
||
# setup jdk 1.8 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
|
||
# make gradlew executeable | ||
- name: Make Gradle Executable | ||
run: chmod +x ./gradlew | ||
|
||
# build using gradle | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
|
||
# build apk | ||
- name: Build Release APK | ||
run: ./gradlew assembleRelease | ||
|
||
# sign APK | ||
- name: Sign APK | ||
id: sign_apk | ||
uses: r0adkll/sign-android-release@v1 | ||
with: | ||
releaseDirectory: app/build/outputs/apk/release | ||
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | ||
alias: ${{ secrets.ALIAS }} | ||
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | ||
keyPassword: ${{ secrets.KEY_PASSWORD }} | ||
|
||
# rename signed apk | ||
- name: Rename Signed APK | ||
run: mv ${{ steps.sign_apk.outputs.signedReleaseFile }} ./tenshi-content.apk | ||
|
||
# upload artifact | ||
- name: Upload APK Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: apk-build | ||
path: ./tenshi-content.apk | ||
|
||
# upload the built apk to github release | ||
upload_github: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
# download artifact from previous step | ||
- name: Download APK Artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: apk-build | ||
path: ./ | ||
|
||
# generate apk checksum | ||
- name: "Generate APK Checksum" | ||
run: sha256sum ./tenshi-content.apk > tenshi-content.sha256 | ||
|
||
# add apk to release | ||
- name: Add APK to release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
body: automatic build | ||
files: | | ||
./tenshi-content.apk | ||
./tenshi-content.sha256 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
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,44 @@ | ||
:: automatic release using git flow release | ||
:: usage: make-release <RELEASE_TAG> | ||
|
||
@echo off | ||
:: check param 1 is set | ||
IF "%~1" == "" ( | ||
echo No RELEASE_TAG specified. | ||
goto:eof | ||
exit 1 | ||
) | ||
|
||
:: user confirm | ||
echo Will create a release %~1 | ||
pause | ||
|
||
:: start a new release | ||
git flow release start %~1 | ||
|
||
:: checkout release branch on submodule extension-lib | ||
git submodule update --init --recursive --remote | ||
pushd .\Extensions-Lib\ | ||
git checkout senpai | ||
popd | ||
|
||
:: pause for last- minute changes | ||
echo. | ||
echo pausing now. do your last- minute changes now or undo with 'git flow release delete %~1' | ||
echo checklist: | ||
echo [ ] Project Compiles correctly | ||
echo [ ] Tag %~1 does not already exist | ||
echo [ ] Switch Extensions-Lib to senpai branch (auto) | ||
echo [ ] Set Version in build.gradle | ||
echo [ ] WebAdapter: Constants adjusted (DEBUG_MODE false, BASE_URL set to release repo) | ||
pause | ||
pause | ||
|
||
:: finish the release | ||
git flow release finish %~1 | ||
|
||
:: push all branches | ||
git push --all | ||
|
||
:: push tags to remote (triggers auto- build) | ||
git push --tags |