我试图为我的Flutter应用程序设置Github Workflow管道,但由于我没有提交我的.env文件,building
和flutter analyze
命令失败。
有没有一种方法可以将.env添加到我的Workflow中,而不必将其提交到源代码控制?
由于.env不应该被提交
name: CI
on:
pull_request:
branches:
- master
- dev
jobs:
flutter_test:
name: Run flutter test and analyze
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: flutter pub get
- run: flutter analyze
- run: flutter test
build_ios:
name: Build Flutter (iOS)
needs: [flutter_test]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: flutter pub get
- run: flutter clean
- run: flutter build ios --release --no-codesign
build_appbundle:
name: Build Flutter (Android)
needs: [flutter_test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: flutter pub get
- run: flutter clean
- run: flutter build appbundle