From 8d12d3d003f316f4370a806b10d8bd8f354fe399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Mon, 22 Jul 2024 16:06:41 -0700 Subject: [PATCH 1/5] Enable AOT build for windows-arm64 --- .github/workflows/build-windows.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index bb97bc1a9..bf7395893 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -19,10 +19,7 @@ jobs: - arch: ia32 runner: windows-latest - arch: arm64 - # This should be windows-arm64, but it's broken by several issues: - # https://github.com/orgs/community/discussions/131594 - # https://github.com/orgs/community/discussions/131754 - runner: windows-latest + runner: windows-arm64 steps: - uses: actions/checkout@v4 @@ -37,8 +34,13 @@ jobs: - uses: bufbuild/buf-setup-action@v1.30.0 with: {github_token: "${{ github.token }}"} + # See: https://github.com/dart-lang/sdk/issues/52266 + - name: Setup Root CA + shell: pwsh + run: Invoke-WebRequest https://pub.dev + - name: Install Dependencies - run: dart pub get --verbose + run: dart pub get - name: Compile Protobuf run: dart run grinder protobuf From 9d87791f708bdbe6c3c52f43837cd489afc390ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Tue, 23 Jul 2024 09:55:46 -0700 Subject: [PATCH 2/5] Refactor to use composite action to initialize --- .github/util/initialize/action.yml | 30 ++++++++++++++++++++++++++++- .github/workflows/build-windows.yml | 22 ++------------------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/.github/util/initialize/action.yml b/.github/util/initialize/action.yml index acfa759c2..16feb2513 100644 --- a/.github/util/initialize/action.yml +++ b/.github/util/initialize/action.yml @@ -17,20 +17,48 @@ runs: with: node-version: "${{ inputs.node-version }}" + # See: https://github.com/dart-lang/sdk/issues/52266 + - run: Invoke-WebRequest https://pub.dev + if: runner.os == 'Windows' + shell: pwsh + + # See: https://github.com/orgs/community/discussions/131594 + # The composite action requires an explict shell, but bash is not available on windows-arm64 runner. + # For the following commands conditionally use bash or pwsh based on the runner.os: - run: dart pub get + if: runner.os != 'Windows' shell: bash + - run: dart pub get + if: runner.os == 'Windows' + shell: pwsh + - run: npm install + if: runner.os != 'Windows' shell: bash + - run: npm install + if: runner.os == 'Windows' + shell: pwsh + - uses: bufbuild/buf-setup-action@v1.30.0 with: {github_token: "${{ inputs.github-token }}"} - name: Check out the language repo + if: github.event_name == 'pull_request' uses: sass/clone-linked-repo@v1 with: {repo: sass/sass, path: build/language} - name: Generate Dart from protobuf + if: runner.os != 'Windows' run: dart run grinder protobuf - env: {UPDATE_SASS_SASS_REPO: false} + env: + UPDATE_SASS_SASS_REPO: ${{ github.event_name == 'pull_request' && 'false' || 'true' }} shell: bash + + - name: Generate Dart from protobuf + if: runner.os == 'Windows' + run: dart run grinder protobuf + env: + UPDATE_SASS_SASS_REPO: ${{ github.event_name == 'pull_request' && 'false' || 'true' }} + shell: pwsh diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index bf7395893..86ea17c22 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -24,26 +24,8 @@ jobs: steps: - uses: actions/checkout@v4 - # See: https://github.com/orgs/community/discussions/131594 - # The composite action requires bash which is not available on windows-arm64 runner. - # - uses: ./.github/util/initialize - # with: {github-token: "${{ github.token }}"} - - - uses: dart-lang/setup-dart@v1 - - - uses: bufbuild/buf-setup-action@v1.30.0 - with: {github_token: "${{ github.token }}"} - - # See: https://github.com/dart-lang/sdk/issues/52266 - - name: Setup Root CA - shell: pwsh - run: Invoke-WebRequest https://pub.dev - - - name: Install Dependencies - run: dart pub get - - - name: Compile Protobuf - run: dart run grinder protobuf + - uses: ./.github/util/initialize + with: {github-token: "${{ github.token }}"} - name: Build run: dart run grinder pkg-standalone-windows-${{ matrix.arch }} From b2344d34ef3470481b24964a234910bc499650ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Tue, 23 Jul 2024 14:03:10 -0700 Subject: [PATCH 3/5] Add a comment --- .github/util/initialize/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/util/initialize/action.yml b/.github/util/initialize/action.yml index 16feb2513..241a329b3 100644 --- a/.github/util/initialize/action.yml +++ b/.github/util/initialize/action.yml @@ -44,6 +44,8 @@ runs: - uses: bufbuild/buf-setup-action@v1.30.0 with: {github_token: "${{ inputs.github-token }}"} + # This composite action requires bash, but bash is not available on windows-arm64 runner. + # Avoid running this composite action on non-PR, so that we can release on windows-arm64. - name: Check out the language repo if: github.event_name == 'pull_request' uses: sass/clone-linked-repo@v1 From 2f85466608c6fb802adafe2ef8e817c7ff32d5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Tue, 23 Jul 2024 14:27:38 -0700 Subject: [PATCH 4/5] Try powershell instead of pwsh --- .github/util/initialize/action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/util/initialize/action.yml b/.github/util/initialize/action.yml index 241a329b3..780e34487 100644 --- a/.github/util/initialize/action.yml +++ b/.github/util/initialize/action.yml @@ -20,18 +20,18 @@ runs: # See: https://github.com/dart-lang/sdk/issues/52266 - run: Invoke-WebRequest https://pub.dev if: runner.os == 'Windows' - shell: pwsh + shell: powershell # See: https://github.com/orgs/community/discussions/131594 # The composite action requires an explict shell, but bash is not available on windows-arm64 runner. - # For the following commands conditionally use bash or pwsh based on the runner.os: + # For the following commands conditionally use bash or powershell based on the runner.os: - run: dart pub get if: runner.os != 'Windows' shell: bash - run: dart pub get if: runner.os == 'Windows' - shell: pwsh + shell: powershell - run: npm install if: runner.os != 'Windows' @@ -39,7 +39,7 @@ runs: - run: npm install if: runner.os == 'Windows' - shell: pwsh + shell: powershell - uses: bufbuild/buf-setup-action@v1.30.0 with: {github_token: "${{ inputs.github-token }}"} @@ -63,4 +63,4 @@ runs: run: dart run grinder protobuf env: UPDATE_SASS_SASS_REPO: ${{ github.event_name == 'pull_request' && 'false' || 'true' }} - shell: pwsh + shell: powershell From 2d14ed6efc01cb560e428283313caf46551b0033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Tue, 23 Jul 2024 15:58:24 -0700 Subject: [PATCH 5/5] Use actions/checkout instead of git command --- .github/util/initialize/action.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/util/initialize/action.yml b/.github/util/initialize/action.yml index 780e34487..ba37f9376 100644 --- a/.github/util/initialize/action.yml +++ b/.github/util/initialize/action.yml @@ -51,16 +51,21 @@ runs: uses: sass/clone-linked-repo@v1 with: {repo: sass/sass, path: build/language} + # Git is not pre-installed on windows-arm64 runner, however actions/checkout support + # downloading repo via GitHub API. + - name: Check out the language repo + if: github.event_name != 'pull_request' + uses: actions/checkout@v4 + with: {repository: sass/sass, path: build/language} + - name: Generate Dart from protobuf if: runner.os != 'Windows' run: dart run grinder protobuf - env: - UPDATE_SASS_SASS_REPO: ${{ github.event_name == 'pull_request' && 'false' || 'true' }} + env: {UPDATE_SASS_SASS_REPO: false} shell: bash - name: Generate Dart from protobuf if: runner.os == 'Windows' run: dart run grinder protobuf - env: - UPDATE_SASS_SASS_REPO: ${{ github.event_name == 'pull_request' && 'false' || 'true' }} + env: {UPDATE_SASS_SASS_REPO: false} shell: powershell