-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: autobuild | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
env: | ||
PROJECT_NAME: "PureNGA" | ||
DOTNET_SDK_VERSION: 7.0.x | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
CCACHE_DIR: ${{ github.workspace }}/.ccache | ||
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" | ||
CCACHE_NOHASHDIR: true | ||
CCACHE_MAXSIZE: 1G | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
fetch-depth: 0 | ||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
cache: 'gradle' | ||
- name: Retrieve version | ||
run: | | ||
echo VERSION=$(echo ${{ github.event.head_commit.id }} | head -c 10) >> $GITHUB_ENV | ||
- name: Set up ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ runner.os }}-${{ github.sha }} | ||
restore-keys: ${{ runner.os }} | ||
- name: Build with Gradle | ||
run: | | ||
echo 'org.gradle.caching=true' >> gradle.properties | ||
echo 'org.gradle.parallel=true' >> gradle.properties | ||
echo 'org.gradle.vfs.watch=true' >> gradle.properties | ||
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties | ||
echo 'android.native.buildOutput=verbose' >> gradle.properties | ||
./gradlew -PappVerName=${{ env.VERSION }} assembleRelease assembleDebug | ||
- name: Upload built apk | ||
if: success() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: snapshot | ||
path: | | ||
${{ github.workspace }}/app/build/outputs/apk | ||
${{ github.workspace }}/app/build/outputs/mapping | ||
- name: Post to channel | ||
if: github.ref == 'refs/heads/master' | ||
env: | ||
CHANNEL_ID: ${{ secrets.TELEGRAM_TO }} | ||
BOT_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | ||
FILE: ${{ github.workspace }}/app/release/BiliRoaming_${{ env.VERSION }}.apk | ||
COMMIT_MESSAGE: |+ | ||
New push to github\! | ||
``` | ||
${{ github.event.head_commit.message }} | ||
```by `${{ github.event.head_commit.author.name }}` | ||
See commit detail [here](${{ github.event.head_commit.url }}) | ||
Snapshot apk is attached \(unsupported by TAICHI\) | ||
run: | | ||
ESCAPED=`python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))'` | ||
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://release%22,%22parse_mode%22:%22MarkdownV2%22,%22caption%22:${ESCAPED}%7D%5D" -F release="@$FILE" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.