我正在尝试使用github操作将apk上传到firebase。我已经注释掉了代码分析和测试,以使操作运行得更快,以便尝试解决问题。我也尝试上传了一个应用程序包,我得到了相同的响应。以下是github操作配置。
name: Deploy app bundle to firebase
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1 # Setup flutter environment
with:
flutter-version: '2.5.0'
- run: flutter pub get
- run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Create env file
run: |
cat << EOF > .env
STAGING_API_BASE_URL="${{ secrets.STAGING_API_BASE_URL }}"
PROD_API_BASE_URL="${{ secrets.PROD_API_BASE_URL }}"
BASE_PATH="${{ secrets.BASE_PATH }}"
EOF
# - run: flutter format --set-exit-if-changed # - run: flutter format --set-exit-if-changed .
#- run: flutter analyze # Analyze the project's Dart code. This causes job to exit
#- name: Run flutter analyze
# run: |
# chmod +x ./flutter_analyze.sh
# ./flutter_analyze.sh
#- run: flutter test # Run Flutter unit tests for the current project.
- name: Build Gradle
run: flutter build apk --debug
- uses: actions/checkout@v2 #This uploads artifacts from your workflow
with:
name: debug-apk
path: build/app/outputs/flutter-apk/app-debug.apk
- run: ls build/app/outputs/flutter-apk
- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1.3.2
with:
appId: ${{secrets.FIREBASE_APP_ID}}
token: ${{secrets.FIREBASE_TOKEN}}
groups: testers
file: build/app/outputs/flutter-apk/app-debug.apk 当我运行工作流时,我得到以下错误:

发布于 2021-11-02 07:21:06
您可以使用以下脚本查找构建的apk路径:
run: |
echo "Find build artifacts"
apkPath=$(find app -name "*.apk" | head -1)
echo "Found apk at $apkPath"
if [[ -z ${apkPath} ]]
then
echo "No apks were found, skip publishing to App Distribution"
else
echo "Publishing $apkPath to App Center"
#publish your apk by using $apkPath
fi它扫描所有代理文件并找到apk文件。
发布于 2021-11-02 08:25:49
我在这一行上犯了一个错误
- uses: actions/checkout@v2 #This uploads artifacts from your workflow评论是正确的,但操作是错误的。我应该用actions/upload-artifact https://github.com/wzieba/Firebase-Distribution-Github-Action/issues/51
https://stackoverflow.com/questions/69805487
复制相似问题