Browse Source

refactor(ci,tool): Simply flutter version extraction

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/915/head
jld3103 1 year ago
parent
commit
5718db9c28
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 11
      .github/workflows/publish.yaml
  2. 7
      tool/build-app.sh

11
.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

7
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

Loading…
Cancel
Save