-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Release Build | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Release Tag' | ||
required: true | ||
plugin: | ||
description: 'Plugin to build' | ||
required: true | ||
upload: | ||
description: 'Upload: If want ignore' | ||
required: false | ||
publish: | ||
description: 'Publish: If want ignore' | ||
required: false | ||
jobs: | ||
check: | ||
name: Check Access | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Check access" | ||
uses: "lannonbr/repo-permission-check-action@2.0.0" | ||
with: | ||
permission: "write" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Gradle cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle | ||
key: gradle-${{ hashFiles('**/*.gradle.kts') }} | ||
- name: Release Build | ||
env: | ||
BUILD_PLUGIN: none | ||
run: | | ||
echo "sdk.dir=${ANDROID_HOME}" > local.properties | ||
echo "ndk.dir=${ANDROID_HOME}/ndk/23.1.7779620" >> local.properties | ||
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" | ||
bash requirement.sh | ||
dl=1 bash make.sh ${{ github.event.inputs.plugin }} | ||
APK=$(find . -name '*arm64-v8a*.apk') | ||
APK=$(dirname $APK) | ||
echo "APK=$APK" >> $GITHUB_ENV | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: APKs | ||
path: ${{ env.APK }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "SHA256-ARM ${{ env.SHA256_ARM }}" | ||
path: ${{ env.SUM_ARM }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "SHA256-ARM64 ${{ env.SHA256_ARM64 }}" | ||
path: ${{ env.SUM_ARM64 }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "SHA256-X64 ${{ env.SHA256_X64 }}" | ||
path: ${{ env.SUM_X64 }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "SHA256-X86 ${{ env.SHA256_X86 }}" | ||
path: ${{ env.SUM_X86 }} | ||
publish: | ||
name: Publish Release | ||
if: github.event.inputs.publish != 'y' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Donwload Artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: APKs | ||
path: artifacts | ||
- name: Release | ||
run: | | ||
wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz | ||
tar -xvf ghr.tar.gz | ||
mv ghr*linux_amd64/ghr . | ||
mkdir apks | ||
find artifacts -name "*.apk" -exec cp {} apks \; | ||
find artifacts -name "*.sha256sum.txt" -exec cp {} apks \; | ||
./ghr -delete -t "${{ github.token }}" -n "${{ github.event.inputs.tag }}" "${{ github.event.inputs.tag }}" apks | ||
upload: | ||
name: Upload Release | ||
if: github.event.inputs.upload != 'y' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Donwload Artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: APKs | ||
path: artifacts | ||
- name: Release | ||
run: | | ||
mkdir apks | ||
find artifacts -name "*.apk" -exec cp {} apks \; | ||
function upload() { | ||
for apk in $@; do | ||
echo ">> Uploading $apk" | ||
curl https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument \ | ||
-X POST \ | ||
-F chat_id="${{ secrets.TELEGRAM_CHANNEL }}" \ | ||
-F document="@$apk" \ | ||
--silent --show-error --fail >/dev/null & | ||
done | ||
for job in $(jobs -p); do | ||
wait $job || exit 1 | ||
done | ||
} | ||
upload apks/* |
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/build | ||
/libs | ||
/html |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
plugins { | ||
id("com.android.application") | ||
id("org.jetbrains.kotlin.android") | ||
} | ||
|
||
setupAll() | ||
|
||
android { | ||
defaultConfig { | ||
applicationId = "moe.matsuri.plugin.xray" | ||
versionCode = 1 | ||
versionName = "v1.5.3-1" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="moe.matsuri.plugin.xray" | ||
android:installLocation="internalOnly"> | ||
|
||
<application | ||
android:allowBackup="false" | ||
android:extractNativeLibs="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="Xray Plugin"> | ||
<provider | ||
android:name=".BinaryProvider" | ||
android:authorities="moe.matsuri.plugin.xray.BinaryProvider" | ||
android:directBootAware="true" | ||
android:exported="true" | ||
tools:ignore="ExportedContentProvider"> | ||
<intent-filter> | ||
<action android:name="io.nekohasekai.sagernet.plugin.ACTION_NATIVE_PLUGIN" /> | ||
</intent-filter> | ||
<intent-filter> | ||
<action android:name="io.nekohasekai.sagernet.plugin.ACTION_NATIVE_PLUGIN" /> | ||
<data | ||
android:host="io.nekohasekai.sagernet" | ||
android:path="/moe.matsuri.plugin.xray" | ||
android:scheme="plugin" /> | ||
</intent-filter> | ||
|
||
<meta-data | ||
android:name="io.nekohasekai.sagernet.plugin.id" | ||
android:value="moe.matsuri.plugin.xray" /> | ||
<meta-data | ||
android:name="io.nekohasekai.sagernet.plugin.executable_path" | ||
android:value="libxray.so" /> | ||
</provider> | ||
</application> | ||
|
||
</manifest> |