-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (74 loc) · 2.49 KB
/
build.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: "Build Binary for MacOS, Linux, and Windows"
on:
push:
branches: [ "main" ]
concurrency:
group: environment-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
jobs:
get-version:
name: "Get Spark Version"
runs-on: "ubuntu-latest"
env:
SPARK_CLIENT_ID: "ClientId"
SPARK_POOL_ID: "PoolId"
SPARK_POOL_REGION: "us-east-1"
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20.4'
- name: Build Spark CLI
run: go build -o spark
- name: Get Spark Version
run: echo "SPARK_VERSION=$(./spark --version)" > spark-version.txt
- name: Upload Spark Version Information
uses: actions/upload-artifact@v1
with:
name: spark-version
path: spark-version.txt
build:
needs: [get-version]
name: "Build Spark Binaries"
runs-on: "ubuntu-latest"
env:
SPARK_CLIENT_ID: "ClientId"
SPARK_POOL_ID: "PoolId"
SPARK_POOL_REGION: "us-east-1"
defaults:
run:
shell: bash
strategy:
matrix:
os: [darwin, linux, windows]
arch: [arm64, amd64]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20.4'
- name: Build Spark CLI
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} make build
- name: Download Spark Version Information
uses: actions/download-artifact@v1
with:
name: spark-version
- name: Get Spark Version Information
id: get-spark-version
run: cat spark-version/spark-version.txt >> "$GITHUB_OUTPUT"
- name: Publish Binary to Releases
uses: svenstaro/upload-release-action@v2
with:
file: spark-${{ matrix.os }}-${{ matrix.arch }}
asset_name: spark-${{ matrix.os }}-${{ matrix.arch }}
tag: ${{ steps.get-spark-version.outputs.SPARK_VERSION }}