-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (61 loc) · 1.95 KB
/
Copy pathbuild.yml
File metadata and controls
70 lines (61 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Bazel Build
on:
push:
tags:
- "v**"
jobs:
build:
runs-on: ${{ matrix.platform }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
platform: ["macos-latest", "ubuntu-latest"]
experimental: [false]
include:
- platform: windows-latest
experimental: true
steps:
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "1.26"
- name: Cache Go Modules
uses: actions/cache@v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install Bazelisk
if: matrix.platform != 'windows-latest'
run: |
go install github.com/bazelbuild/bazelisk@latest
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
export USE_BAZEL_VERSION=8.3.0
bazel version
- name: Install Bazelisk on Windows
if: matrix.platform == 'windows-latest'
run: |
go install github.com/bazelbuild/bazelisk@latest
echo "$(go env GOPATH)\bin" >> $GITHUB_PATH
setx USE_BAZEL_VERSION 8.3.0
bazel version
- name: Checkout code
uses: actions/checkout@v3
- name: Build with Bazel
if: matrix.platform != 'windows-latest'
run: |
bazel build //tetris:tetris --verbose_failures
echo "binary_path=$(bazel info bazel-bin)/tetris" >> $GITHUB_ENV
- name: Build with Bazel on Windows
if: matrix.platform == 'windows-latest'
run: |
bazel build //tetris:tetris --verbose_failures
echo "binary_path=$(bazel info bazel-bin)\tetris" >> $GITHUB_ENV
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: tetris-artifact-${{ matrix.platform }}
path: |
${{ env.binary_path }}*