-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
127 additions
and
66 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 |
---|---|---|
|
@@ -3,8 +3,6 @@ name: Android | |
on: | ||
push: | ||
branches: [ "*", "*/*" ] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: [ "*", "*/*" ] | ||
|
||
|
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,127 @@ | ||
name: Release All Platforms | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
go-releases: | ||
name: Release Go Binary | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
goos: [linux, windows, darwin] | ||
goarch: [386, amd64, arm64] | ||
include: | ||
- goos: linux | ||
goarch: arm | ||
goarm: 7 | ||
- goos: linux | ||
goarch: mips | ||
gomips: softfloat | ||
- goos: linux | ||
goarch: mipsle | ||
gomips: softfloat | ||
- goos: linux | ||
goarch: mips64 | ||
- goos: linux | ||
goarch: mips64le | ||
exclude: | ||
- goos: darwin | ||
goarch: arm | ||
- goos: darwin | ||
goarch: 386 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set APP_VERSION env | ||
run: echo APP_VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV} | ||
|
||
- name: Set ldflags as environment variable | ||
run: | | ||
if [ ${{ matrix.goos }} == 'linux' ]&&[ ${{ matrix.goarch }} == 'amd64' ]; then | ||
LD_FLAGS="-X main.Version=${{ env.APP_VERSION }} -linkmode 'external' -extldflags '-static'" | ||
else | ||
LD_FLAGS="-X main.Version=${{ env.APP_VERSION }}" | ||
fi | ||
echo "LD_FLAGS=$LD_FLAGS" >> ${GITHUB_ENV} | ||
- uses: pdahd/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
goarm: ${{ matrix.goarm }} | ||
gomips: ${{ matrix.gomips }} | ||
project_path: "." | ||
binary_name: "CloudflareWarpSpeedTest" | ||
goversion: "1.22" | ||
ldflags: "${{ env.LD_FLAGS }}" | ||
|
||
android-release: | ||
name: Release Android APK | ||
runs-on: ubuntu-latest | ||
needs: go-releases | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x android/gradlew | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
with: | ||
sdk-platform: '34' | ||
build-tools: '34.0.0' | ||
|
||
- name: Build Release APK | ||
working-directory: ./android | ||
run: ./gradlew assembleRelease | ||
|
||
- name: Sign Release APK | ||
uses: r0adkll/sign-android-release@v1 | ||
with: | ||
releaseDirectory: android/app/build/outputs/apk/release | ||
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | ||
alias: ${{ secrets.KEY_ALIAS }} | ||
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | ||
keyPassword: ${{ secrets.KEY_PASSWORD }} | ||
env: | ||
BUILD_TOOLS_VERSION: "34.0.0" | ||
|
||
- name: Rename APK with Version | ||
run: | | ||
VERSION=${GITHUB_REF#refs/tags/} | ||
mv ${{ env.SIGNED_RELEASE_FILE }} android/app/build/outputs/apk/release/CloudflareWarpSpeedTest-${VERSION}.apk | ||
echo "RELEASE_APK=android/app/build/outputs/apk/release/CloudflareWarpSpeedTest-${VERSION}.apk" >> $GITHUB_ENV | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
${{ env.RELEASE_APK }} | ||
draft: false | ||
prerelease: false | ||
generate_release_notes: true |
This file was deleted.
Oops, something went wrong.