diff --git a/.github/util/initialize/action.yml b/.github/util/initialize/action.yml index acfa759c2..ba37f9376 100644 --- a/.github/util/initialize/action.yml +++ b/.github/util/initialize/action.yml @@ -17,20 +17,55 @@ 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: 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 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: powershell + - run: npm install + if: runner.os != 'Windows' shell: bash + - run: npm install + if: runner.os == 'Windows' + shell: powershell + - 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 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: false} shell: bash + + - name: Generate Dart from protobuf + if: runner.os == 'Windows' + run: dart run grinder protobuf + env: {UPDATE_SASS_SASS_REPO: false} + shell: powershell diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index bb97bc1a9..86ea17c22 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -19,29 +19,13 @@ 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 - # 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 }}"} - - - name: Install Dependencies - run: dart pub get --verbose - - - 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 }}