Skip to content

Commit 9e9cd72

Browse files
ci: Fix issues in release.yml file
- Fix permissions for GitHub token - Skip installing Bazelisk if already present - Use the default shell as bash, even on Windows - Skip macOS since GitHub-hosted M1 runners are not yet available
1 parent c2579a7 commit 9e9cd72

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/release.yml

+20-6
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,29 @@ jobs:
1919
name: 'Build and upload artifacts'
2020
strategy:
2121
matrix:
22-
platform: ['ubuntu-20.04', 'macos-12', 'windows-2022']
22+
# TODO: Add macos-12 once
23+
# https://github.com/github/roadmap/issues/528 is fixed
24+
platform: ['ubuntu-20.04', 'windows-2022']
2325
config: ['dev', 'release']
2426
runs-on: ${{ matrix.platform }}
2527
env:
2628
TAG: ${{ github.event.ref }}
29+
permissions:
30+
contents: 'read'
31+
id-token: 'write'
32+
defaults:
33+
run:
34+
shell: bash
2735
steps:
2836
- uses: actions/checkout@v3
2937
- name: '🐍 Install Bazelisk'
3038
run: |
31-
if [ "$RUNNER_OS" == "Windows" ]; then
32-
choco install bazelisk
33-
else
34-
sudo npm install -g @bazel/bazelisk
39+
if ! command -v bazelisk; then
40+
if [ "$RUNNER_OS" == "Windows" ]; then
41+
choco install bazelisk
42+
else
43+
sudo npm install -g @bazel/bazelisk
44+
fi
3545
fi
3646
- id: auth
3747
name: '🔓 Authenticate to Google Cloud'
@@ -42,6 +52,10 @@ jobs:
4252
create_credentials_file: true
4353
- name: '🚧 Build scip-clang'
4454
run: |
55+
# Stop Windows from converting the // to /
56+
# https://github.com/bazelbuild/bazel/commit/866ecc8c3d5e0b899e3f0c9c6b2265f16daae842
57+
# https://stackoverflow.com/a/34386471
58+
export MSYS2_ARG_CONV_EXCL="*"
4559
echo "build --remote_cache=$CI_BAZEL_REMOTE_CACHE --google_default_credentials" > ci.bazelrc
4660
bazel build //indexer:scip-clang --config="$CONFIG" --execution_log_binary_file=log
4761
env:
@@ -100,4 +114,4 @@ jobs:
100114
- name: '📤 Upload artifacts for release'
101115
run: gh release upload "${GITHUB_REF/refs\/tags\//}" ./*-release-artifacts/*
102116
env:
103-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)