Skip to content

Commit e03547f

Browse files
authored
Enable AOT build for windows-arm64 (#2286)
1 parent 0cf4768 commit e03547f

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed

.github/util/initialize/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,55 @@ runs:
1717
with:
1818
node-version: "${{ inputs.node-version }}"
1919

20+
# See: https://github.com/dart-lang/sdk/issues/52266
21+
- run: Invoke-WebRequest https://pub.dev
22+
if: runner.os == 'Windows'
23+
shell: powershell
24+
25+
# See: https://github.com/orgs/community/discussions/131594
26+
# The composite action requires an explict shell, but bash is not available on windows-arm64 runner.
27+
# For the following commands conditionally use bash or powershell based on the runner.os:
2028
- run: dart pub get
29+
if: runner.os != 'Windows'
2130
shell: bash
2231

32+
- run: dart pub get
33+
if: runner.os == 'Windows'
34+
shell: powershell
35+
2336
- run: npm install
37+
if: runner.os != 'Windows'
2438
shell: bash
2539

40+
- run: npm install
41+
if: runner.os == 'Windows'
42+
shell: powershell
43+
2644
- uses: bufbuild/[email protected]
2745
with: {github_token: "${{ inputs.github-token }}"}
2846

47+
# This composite action requires bash, but bash is not available on windows-arm64 runner.
48+
# Avoid running this composite action on non-PR, so that we can release on windows-arm64.
2949
- name: Check out the language repo
50+
if: github.event_name == 'pull_request'
3051
uses: sass/clone-linked-repo@v1
3152
with: {repo: sass/sass, path: build/language}
3253

54+
# Git is not pre-installed on windows-arm64 runner, however actions/checkout support
55+
# downloading repo via GitHub API.
56+
- name: Check out the language repo
57+
if: github.event_name != 'pull_request'
58+
uses: actions/checkout@v4
59+
with: {repository: sass/sass, path: build/language}
60+
3361
- name: Generate Dart from protobuf
62+
if: runner.os != 'Windows'
3463
run: dart run grinder protobuf
3564
env: {UPDATE_SASS_SASS_REPO: false}
3665
shell: bash
66+
67+
- name: Generate Dart from protobuf
68+
if: runner.os == 'Windows'
69+
run: dart run grinder protobuf
70+
env: {UPDATE_SASS_SASS_REPO: false}
71+
shell: powershell

.github/workflows/build-windows.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,13 @@ jobs:
1919
- arch: ia32
2020
runner: windows-latest
2121
- arch: arm64
22-
# This should be windows-arm64, but it's broken by several issues:
23-
# https://github.com/orgs/community/discussions/131594
24-
# https://github.com/orgs/community/discussions/131754
25-
runner: windows-latest
22+
runner: windows-arm64
2623

2724
steps:
2825
- uses: actions/checkout@v4
2926

30-
# See: https://github.com/orgs/community/discussions/131594
31-
# The composite action requires bash which is not available on windows-arm64 runner.
32-
# - uses: ./.github/util/initialize
33-
# with: {github-token: "${{ github.token }}"}
34-
35-
- uses: dart-lang/setup-dart@v1
36-
37-
- uses: bufbuild/[email protected]
38-
with: {github_token: "${{ github.token }}"}
39-
40-
- name: Install Dependencies
41-
run: dart pub get --verbose
42-
43-
- name: Compile Protobuf
44-
run: dart run grinder protobuf
27+
- uses: ./.github/util/initialize
28+
with: {github-token: "${{ github.token }}"}
4529

4630
- name: Build
4731
run: dart run grinder pkg-standalone-windows-${{ matrix.arch }}

0 commit comments

Comments
 (0)