我如何通过github-actions生成Android调试密钥库文件?

问题描述 投票:1回答:1

[我正在尝试通过github操作工作流生成android调试密钥库文件,并且也成功生成了,但是在第一个keytool命令之后生成了错误。

[工作流程YAML-

name: APK Build CI

on:

  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build-upload:
    runs-on: windows-latest
    steps:
      - uses: actions/[email protected]
        with:
          java-version: '12.x'
      - name: Generating debug keystore and SHA1 key
        shell: powershell
        run: |
          keytool -genkey -dname "cn=Abhishek Dubey, ou=DSCBVPPUNE, o=Google, l=Pune, st=Maharashtra, c=IN" -keystore "%USERPROFILE%\.android\debug.keystore" -storepass android -alias android -keyalg RSA -keysize 4096 -validity 10000 -v
          keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias android -storepass android -keypass android
      - uses: subosito/[email protected]
        with:
          channel: 'stable'
      - uses: actions/[email protected]
      - run: flutter doctor -v
      - run: flutter pub get
      - run: flutter build apk --debug
      - name: Upload APK artifact
        uses: actions/[email protected]
        with:
          name: dsc-app-debug
          path: build\app\outputs\apk\debug\app-debug.apk

这是工作流程错误日志-

2020-03-30T10:51:07.0942983Z ##[section]Starting: Request a runner to run this job
2020-03-30T10:51:07.1787698Z Requesting a hosted runner in current repository's account/organization with labels: 'windows-latest', require runner match: True
2020-03-30T10:51:07.2818901Z Labels matched hosted runners has been found, waiting for one of them get assigned for this job.
2020-03-30T10:51:07.3281652Z ##[section]Finishing: Request a runner to run this job
2020-03-30T10:51:12.2777678Z Current runner version: '2.165.2'
2020-03-30T10:51:12.2779084Z Prepare workflow directory
2020-03-30T10:51:12.3126736Z Prepare all required actions
2020-03-30T10:51:12.3144714Z Download action repository 'actions/[email protected]'
2020-03-30T10:51:14.2626826Z Download action repository 'subosito/[email protected]'
2020-03-30T10:51:14.5595001Z Download action repository 'actions/[email protected]'
2020-03-30T10:51:14.7296316Z Download action repository 'actions/[email protected]'
2020-03-30T10:51:15.0924171Z ##[group]Run actions/[email protected]
2020-03-30T10:51:15.0924559Z with:
2020-03-30T10:51:15.0924791Z   java-version: 12.x
2020-03-30T10:51:15.0924939Z   java-package: jdk
2020-03-30T10:51:15.0925077Z   architecture: x64
2020-03-30T10:51:15.0925218Z ##[endgroup]
2020-03-30T10:51:19.7216639Z [command]C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('d:\a\_temp\7de345a4-212a-4cde-89db-b56d983114a6', 'd:\a\_temp\temp_1332655762')"
2020-03-30T10:51:27.2442931Z Added matchers: 'java'. Problem matchers scan action output for known warning or error strings and report these inline.
2020-03-30T10:51:27.2443791Z creating settings.xml with server-id: github; environment variables: username=$GITHUB_ACTOR and password=$GITHUB_TOKEN
2020-03-30T10:51:27.2444263Z writing C:\Users\runneradmin\.m2\settings.xml
2020-03-30T10:51:27.2756164Z ##[group]Run keytool -genkey -dname "cn=Abhishek Dubey, ou=DSCBVPPUNE, o=Google, l=Pune, st=Maharashtra, c=IN" -keystore "%USERPROFILE%\.android\debug.keystore" -storepass android -alias android -keyalg RSA -keysize 4096 -validity 10000 -v
2020-03-30T10:51:27.2756653Z [36;1mkeytool -genkey -dname "cn=Abhishek Dubey, ou=DSCBVPPUNE, o=Google, l=Pune, st=Maharashtra, c=IN" -keystore "%USERPROFILE%\.android\debug.keystore" -storepass android -alias android -keyalg RSA -keysize 4096 -validity 10000 -v[0m
2020-03-30T10:51:27.2756873Z [36;1mkeytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias android -storepass android -keypass android[0m
2020-03-30T10:51:27.2796986Z shell: C:\windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "{0}""
2020-03-30T10:51:27.2797308Z env:
2020-03-30T10:51:27.2797432Z   JAVA_HOME: C:\hostedtoolcache\windows\jdk\12.0.2\x64
2020-03-30T10:51:27.2797563Z   JAVA_HOME_12.0.2_x64: C:\hostedtoolcache\windows\jdk\12.0.2\x64
2020-03-30T10:51:27.2797706Z ##[endgroup]
2020-03-30T10:51:33.1348518Z Generating 4,096 bit RSA key pair and self-signed certificate (SHA384withRSA) with a validity of 10,000 days
2020-03-30T10:51:33.1351683Z    for: CN=Abhishek Dubey, OU=DSCBVPPUNE, O=Google, L=Pune, ST=Maharashtra, C=IN
2020-03-30T10:51:33.2985238Z [Storing C:\Users\runneradmin\.android\debug.keystore]
2020-03-30T10:51:33.3942546Z keytool error: java.io.FileNotFoundException: C:\Users\runneradmin\.android\debug.keystore (The system cannot find the path specified)
2020-03-30T10:51:33.3946273Z java.io.FileNotFoundException: C:\Users\runneradmin\.android\debug.keystore (The system cannot find the path specified)
2020-03-30T10:51:33.3947754Z    at java.base/java.io.FileOutputStream.open0(Native Method)
2020-03-30T10:51:33.3948500Z    at java.base/java.io.FileOutputStream.open(FileOutputStream.java:292)
2020-03-30T10:51:33.3948997Z    at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
2020-03-30T10:51:33.3949599Z    at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:124)
2020-03-30T10:51:33.3950138Z    at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:1333)
2020-03-30T10:51:33.3950637Z    at java.base/sun.security.tools.keytool.Main.run(Main.java:409)
2020-03-30T10:51:33.3950994Z    at java.base/sun.security.tools.keytool.Main.main(Main.java:402)
2020-03-30T10:51:33.5856551Z keytool error: java.lang.Exception: Keystore file does not exist: C:\Users\runneradmin\.android\debug.keystore
2020-03-30T10:51:33.5859287Z java.lang.Exception: Keystore file does not exist: C:\Users\runneradmin\.android\debug.keystore
2020-03-30T10:51:33.5859446Z    at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:899)
2020-03-30T10:51:33.5859564Z    at java.base/sun.security.tools.keytool.Main.run(Main.java:409)
2020-03-30T10:51:33.5859874Z    at java.base/sun.security.tools.keytool.Main.main(Main.java:402)
2020-03-30T10:51:33.6251340Z ##[error]Process completed with exit code 1.
2020-03-30T10:51:33.6413059Z Cleaning up orphan processes

我在做什么错?

github android-keystore github-actions
1个回答
0
投票

我将与您分享此Github Gist。基本上,这是一个生成debug apk并将其添加为附加资产发布的示例。

© www.soinside.com 2019 - 2024. All rights reserved.