Skip to content

Commit

Permalink
Build SFA
Browse files Browse the repository at this point in the history
  • Loading branch information
PuerNya committed Nov 3, 2023
1 parent 729dbe7 commit 11d6344
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 247 deletions.
77 changes: 0 additions & 77 deletions .github/ISSUE_TEMPLATE/bug_report.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/ISSUE_TEMPLATE/bug_report_zh.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/renovate.json

This file was deleted.

5 changes: 0 additions & 5 deletions .github/update_dependencies.sh

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/docker.yml

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/sfa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build SFA

on:
push:

jobs:
build:
runs-on: ubuntu-latest
env:
TAGS: "with_quic,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_clash_api,with_v2ray_api,with_gvisor"

steps:
- uses: actions/checkout@v4.1.0
with:
fetch-depth: 0

- name: Get latest go version
id: go_version
run: |
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
- name: Setup Go
uses: actions/setup-go@v4.1.0
with:
go-version: 1.21.1

- name: Checkout SFA Repository
uses: actions/checkout@v3
with:
repository: SagerNet/sing-box-for-android
path: SFA
submodules: recursive

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: 20

- name: Build SFA
run: |
git remote add sekai https://github.com/SagerNet/sing-box
git fetch sekai
mkdir -p SFA/app/libs/
make lib_install
version=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag)
CGO_ENABLED=0 gomobile bind -v -a -trimpath -androidapi 21 -javapkg=io.nekohasekai -libname=box -tags ${TAGS} -ldflags "-X github.com/sagernet/sing-box/constant.Version=${version} -s -w -buildid=" ./experimental/libbox
cp ./libbox.aar SFA/app/libs/
cd SFA
echo "VERSION_NAME=${version}" > local.properties
echo "VERSION_CODE=$(date +%Y%m%d%H)" >> local.properties
sed -i '/signingConfigs\.release/d' app/build.gradle
chmod +x ./gradlew
./gradlew assembleRelease
- name: Sign SFA
uses: PuerNya/sign-android-release@v2
with:
releaseDirectory: SFA/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGN_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}

- name: Upload arm64-v8a artifact
uses: actions/upload-artifact@v3
with:
name: SFA-arm64-v8a
path: |
SFA/app/build/outputs/apk/release/*-arm64-v8a-signed.apk
SFA/app/build/outputs/apk/release/*-arm64-v8a-*-signed.apk
- name: Upload armeabi-v7a artifact
uses: actions/upload-artifact@v3
with:
name: SFA-armeabi-v7a
path: |
SFA/app/build/outputs/apk/release/*-armeabi-v7a-signed.apk
SFA/app/build/outputs/apk/release/*-armeabi-v7a-*-signed.apk
- name: Upload x86_64 artifact
uses: actions/upload-artifact@v3
with:
name: SFA-x86_64
path: |
SFA/app/build/outputs/apk/release/*-x86_64-signed.apk
SFA/app/build/outputs/apk/release/*-x86_64-*-signed.apk
- name: Upload x86 artifact
uses: actions/upload-artifact@v3
with:
name: SFA-x86
path: |
SFA/app/build/outputs/apk/release/*-x86-signed.apk
SFA/app/build/outputs/apk/release/*-x86-*-signed.apk
- name: Upload universal artifact
uses: actions/upload-artifact@v3
with:
name: SFA-universal
path: |
SFA/app/build/outputs/apk/release/*-universal-signed.apk
SFA/app/build/outputs/apk/release/*-universal-*-signed.apk
15 changes: 0 additions & 15 deletions .github/workflows/stale.yml

This file was deleted.

0 comments on commit 11d6344

Please sign in to comment.