diff --git a/.github/actions/setup_env/action.yml b/.github/actions/setup_env/action.yml index da98aab7..3809966d 100644 --- a/.github/actions/setup_env/action.yml +++ b/.github/actions/setup_env/action.yml @@ -1,26 +1,36 @@ name: Setup Flutter environment description: Setup Flutter environment +inputs: + java-version: + description: 'Java Version' + required: true + flutter-channel: + description: 'Flutter Channel' + required: true runs: - using: "composite" + using: 'composite' steps: # Setup the Java environment. - uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: ${{vars.JAVA_VERSION}} + java-version: ${{inputs.java-version}} cache: 'gradle' # Setup the Flutter environment. - uses: subosito/flutter-action@v2 with: - channel: ${{vars.FLUTTER_CHANNEL}} + channel: ${{inputs.flutter-channel}} cache: true # No dart analytics. - run: dart --disable-analytics + shell: bash # No flutter analytics. - run: flutter config --disable-analytics + shell: bash # Get flutter dependencies. - - run: flutter pub get \ No newline at end of file + - run: flutter pub get + shell: bash \ No newline at end of file diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 50c653a6..8780ea90 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -1,7 +1,11 @@ -name: Check +name: Syntax Check on: push: + # Ignore develop branch, will be triggered by workflow_call in release.yml + branches-ignore: + - develop + workflow_call: jobs: analyze: @@ -12,6 +16,9 @@ jobs: # Call setup_env action to setup workspace - uses: ./.github/actions/setup_env + with: + java-version: ${{ vars.JAVA_VERSION }} + flutter-channel: ${{ vars.FLUTTER_CHANNEL }} # Check for any formatting issues in the code. - run: dart format --set-exit-if-changed . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44156afd..a2ccf8fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,14 +12,21 @@ env: PROPERTIES_PATH: "./android/key.properties" jobs: + check: + uses: ./.github/workflows/commit.yml + build: runs-on: ubuntu-latest + needs: [check] steps: - uses: actions/checkout@v4 # Call setup_env action to setup workspace - uses: ./.github/actions/setup_env + with: + java-version: ${{ vars.JAVA_VERSION }} + flutter-channel: ${{ vars.FLUTTER_CHANNEL }} # Generate keystore - uses: timheuer/base64-to-file@v1.2