diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9405ed5d..4864e760 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -23,9 +23,6 @@ jobs: - name: Checkout uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - - name: Set flutter version - id: flutter_version - run: echo "FLUTTER_VERSION=$(jq ".flutterSdkVersion" -r < .fvm/fvm_config.json | cut -d "@" -f 1)" >> $GITHUB_OUTPUT - name: Set build number id: build_number run: echo "BUILD_NUMBER=$(date +"%s")" >> $GITHUB_OUTPUT @@ -37,10 +34,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + - uses: kuhnroyal/flutter-fvm-config-action@v1 + id: fvm_config - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # v2 with: - flutter-version: ${{ needs.setup.outputs.flutter_version }} - channel: 'stable' + flutter-version: ${{ steps.fvm_config.outputs.FLUTTER_VERSION }} + channel: ${{ steps.fvm_config.outputs.FLUTTER_CHANNEL }} cache: true - name: Pub dependency cache uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 @@ -137,8 +136,6 @@ jobs: platforms: linux/${{ matrix.architecture.docker }} - name: Build - env: - FLUTTER_VERSION: ${{ needs.setup.outputs.flutter_version }} run: ./tool/build-app.sh linux/${{ matrix.architecture.docker }} --build-number="${{ needs.setup.outputs.build_number }}" - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 diff --git a/tool/build-app.sh b/tool/build-app.sh index bd3435be..c3509dbf 100755 --- a/tool/build-app.sh +++ b/tool/build-app.sh @@ -13,11 +13,6 @@ if ! [[ ${targets[*]} =~ "$target" ]]; then exit 1 fi -if [ ! -v FLUTTER_VERSION ]; then - # shellcheck disable=SC2155 - export FLUTTER_VERSION="$(jq ".flutterSdkVersion" -r < .fvm/fvm_config.json | cut -d "@" -f 1)" -fi - if [[ "$target" == "linux/arm64" ]] || [[ "$target" == "linux/amd64" ]]; then os="$(echo "$target" | cut -d "/" -f 1)" arch="$(echo "$target" | cut -d "/" -f 2)" @@ -29,7 +24,7 @@ if [[ "$target" == "linux/arm64" ]] || [[ "$target" == "linux/amd64" ]]; then --platform "$target" \ --progress plain \ --tag "$tag" \ - --build-arg="FLUTTER_VERSION=$FLUTTER_VERSION" \ + --build-arg="FLUTTER_VERSION=$(jq ".flutterSdkVersion" -r < .fvm/fvm_config.json | cut -d "@" -f 1)" \ $(cache_build_args "$tag") \ -f "tool/build/Dockerfile.$os" \ ./tool/build