Fix publication issues (#134) #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- '*' # Push events to matching *, i.e. 1.0, 20.15.10 | |
workflow_dispatch: | |
jobs: | |
analyse: | |
name: Analyse Flutter | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- name: Install dependencies | |
run: flutter pub get | |
# Uncomment this step to verify the use of 'dart format' on each commit. | |
# - name: Verify formatting | |
# run: dart format --output=none --set-exit-if-changed . | |
# run: dart format --output=none --set-exit-if-changed example | |
# Consider passing '--fatal-infos' for slightly stricter analysis. | |
- name: Analyze project source | |
run: flutter analyze --no-fatal-infos | |
# job responsible for running Flutter tests on iOS devices | |
test_ios: | |
name: Testing iOS | |
needs: analyse | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
architecture: arm64 # optional value for v2 (use self-hosted mac mini) | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Run pod update | |
working-directory: ./example/ios | |
run: pod update | |
- name: List all simulators | |
run: xcrun xctrace list devices | |
- name: Build & run all tests | |
run: sh .github/scripts/uitests_for_ios.sh | |
- name: Archive test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs_ios | |
path: example/machine.log | |
# job responsible for running Flutter tests on Android devices | |
test_android: | |
name: Testing Android | |
needs: analyse | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
architecture: arm64 # optional value for v2 (use self-hosted mac mini) | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build & run all tests | |
run: sh .github/scripts/uitests_for_android.sh | |
- name: Archive test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs_android | |
path: example/machine.log | |
release: | |
name: Create Release | |
needs: [ test_ios, test_android ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set Android SDK version as ENV | |
run: | | |
echo "android_sdk_version=$(sh .github/scripts/extract_android_sdk_version.sh)" >> $GITHUB_ENV | |
- name: Print Android SDK Version | |
run: | | |
echo "Android SDK version is: ${{ env.android_sdk_version }}" | |
- name: Set iOS SDK version as ENV | |
run: | | |
echo "ios_sdk_version=$(sh .github/scripts/extract_ios_sdk_version.sh)" >> $GITHUB_ENV | |
- name: Print iOS SDK Version | |
run: | | |
echo "iOS SDK version is: ${{ env.ios_sdk_version }}" | |
- name: Set Flutter version as ENV | |
run: | | |
echo "flutter_version=$(sh .github/scripts/extract_flutter_version.sh)" >> $GITHUB_ENV | |
- name: Print Flutter Version | |
run: | | |
echo "Flutter version is: ${{ env.flutter_version }}" | |
- name: Create Release | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} # Use custom token to trigger following workflows | |
script: | | |
github.rest.repos.createRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
name: "${{ env.flutter_version }}", | |
tag_name: "${{ env.flutter_version }}", | |
draft: false, | |
prerelease: false, | |
body: "- Update latest versions of native Android (${{ env.android_sdk_version }}) and iOS (${{ env.ios_sdk_version }}) sdks\n\nMore info: https://developers.didomi.io/cmp/mobile-sdk" | |
}); |