Skip to content

Commit 14bf530

Browse files
authored
Set architecture options from runner's architecture (#264)
* feat: Add ARCH_NAME variable and set default ARCH value * chore: Show runner's os and architecture * chore: Update actions
1 parent 02b923c commit 14bf530

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.github/workflows/workflow.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
lint_shellcheck:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- uses: ludeeus/action-shellcheck@master
1717
test_channel:
1818
runs-on: ${{ matrix.operating-system }}
@@ -24,13 +24,16 @@ jobs:
2424
- operating-system: ubuntu-latest
2525
channel: main
2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828
- id: flutter-action
2929
uses: ./
3030
with:
3131
channel: ${{ matrix.channel }}
3232
- name: Echo outputs
3333
run: |
34+
echo RUNNER-OS=${{ runner.os }}
35+
echo RUNNER-ARCH=${{ runner.arch }}
36+
3437
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }}
3538
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }}
3639
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }}
@@ -47,7 +50,7 @@ jobs:
4750
matrix:
4851
operating-system: [ubuntu-latest, windows-latest, macos-latest]
4952
steps:
50-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@v4
5154
- uses: ./
5255
with:
5356
channel: stable
@@ -60,7 +63,7 @@ jobs:
6063
test_print_output:
6164
runs-on: macos-latest
6265
steps:
63-
- uses: actions/checkout@v3
66+
- uses: actions/checkout@v4
6467
- run: ./setup.sh -t -p | grep 'stable'
6568
shell: bash
6669
- run: ./setup.sh -t -p | grep '3.7.7'

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
run: $GITHUB_ACTION_PATH/setup.sh -p -c '${{ inputs.cache-path }}' -k '${{ inputs.cache-key }}' -n '${{ inputs.flutter-version }}' -a '${{ inputs.architecture }}' ${{ inputs.channel }}
5050
shell: bash
5151
- if: ${{ inputs.cache == 'true' }}
52-
uses: actions/cache@v3
52+
uses: actions/cache@v4
5353
with:
5454
path: ${{ steps.flutter-action.outputs.CACHE-PATH }}
5555
key: ${{ steps.flutter-action.outputs.CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}

setup.sh

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ if ! check_command jq; then
1010
fi
1111

1212
OS_NAME=$(echo "$RUNNER_OS" | awk '{print tolower($0)}')
13+
ARCH_NAME=$(echo "$RUNNER_ARCH" | awk '{print tolower($0)}')
1314
MANIFEST_BASE_URL="https://storage.googleapis.com/flutter_infra_release/releases"
1415
MANIFEST_JSON_PATH="releases_$OS_NAME.json"
1516
MANIFEST_URL="$MANIFEST_BASE_URL/$MANIFEST_JSON_PATH"
@@ -83,6 +84,8 @@ while getopts 'tc:k:pa:n:' flag; do
8384
esac
8485
done
8586

87+
[[ -z $ARCH ]] && ARCH="$ARCH_NAME"
88+
8689
ARR_CHANNEL=("${@:$OPTIND:1}")
8790
CHANNEL="${ARR_CHANNEL[0]}"
8891

0 commit comments

Comments
 (0)