mirror of
https://github.com/ZCShou/GoGoGo.git
synced 2026-06-05 21:00:50 +08:00
ci: fix build error
This commit is contained in:
parent
67a06a33d9
commit
aa6ac5219e
10
.github/workflows/build-check.yml
vendored
10
.github/workflows/build-check.yml
vendored
@ -30,7 +30,7 @@ jobs:
|
||||
# 该 job 的一系列步骤。每个以“-”开头
|
||||
steps:
|
||||
# 检出我们的源代码
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
# 设置 JDK
|
||||
- name: set up JDK 17
|
||||
@ -39,7 +39,13 @@ jobs:
|
||||
java-version: '17'
|
||||
distribution: 'adopt'
|
||||
cache: gradle
|
||||
|
||||
# 创建 local.properties 文件
|
||||
- name: Create local.properties
|
||||
run: |
|
||||
cat << EOF > local.properties
|
||||
MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}
|
||||
MAPS_SAFE_CODE=${{ secrets.MAPS_SAFE_CODE }}
|
||||
EOF
|
||||
# 给 gradlew 增加执行权限
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
20
.github/workflows/build-release.yml
vendored
20
.github/workflows/build-release.yml
vendored
@ -12,10 +12,10 @@ permissions:
|
||||
jobs:
|
||||
Build:
|
||||
name: Release APK
|
||||
runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# https://github.com/marketplace/actions/checkout
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
# 设置 JDK
|
||||
- name: set up JDK 17
|
||||
@ -29,6 +29,14 @@ jobs:
|
||||
id: var
|
||||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
||||
|
||||
# 创建 local.properties 文件
|
||||
- name: Create local.properties
|
||||
run: |
|
||||
cat << EOF > local.properties
|
||||
MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}
|
||||
MAPS_SAFE_CODE=${{ secrets.MAPS_SAFE_CODE }}
|
||||
EOF
|
||||
|
||||
- name: Build APK
|
||||
run: bash ./gradlew assembleRelease
|
||||
|
||||
@ -52,10 +60,16 @@ jobs:
|
||||
env:
|
||||
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
|
||||
|
||||
- name: Get Signed APK Name
|
||||
run: |
|
||||
FULL_PATH=${{steps.sign_apk.outputs.signedReleaseFile}}
|
||||
FILENAME=$(basename "$FULL_PATH")
|
||||
echo "FILENAME=${FILENAME}" >> $GITHUB_ENV # 存储到环境变量
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{steps.sign_apk.outputs.signedReleaseFile}}
|
||||
name: ${{ env.FILENAME }}
|
||||
path: ${{steps.sign_apk.outputs.signedReleaseFile}}
|
||||
|
||||
# https://github.com/marketplace/actions/auto-changelog
|
||||
|
||||
13
.github/workflows/codeql-analysis.yml
vendored
13
.github/workflows/codeql-analysis.yml
vendored
@ -43,13 +43,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Set Swap Space
|
||||
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0
|
||||
with:
|
||||
swap-size-gb: 10
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
|
||||
uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
- name: Set up JDK 17
|
||||
@ -57,10 +57,17 @@ jobs:
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: 17
|
||||
# 创建 local.properties 文件
|
||||
- name: Create local.properties
|
||||
run: |
|
||||
cat << EOF > local.properties
|
||||
MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}
|
||||
MAPS_SAFE_CODE=${{ secrets.MAPS_SAFE_CODE }}
|
||||
EOF
|
||||
- name: Assemble
|
||||
run: |
|
||||
mkdir -p "$HOME/.gradle"
|
||||
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
|
||||
./gradlew assembleDebug
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
|
||||
uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
|
||||
Loading…
Reference in New Issue
Block a user