-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.24 KB
/
build-release.yaml
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
name: Build
on:
pull_request: {}
push:
tags:
- v*
jobs:
prepare-release:
name: Prepare release
runs-on: ubuntu-latest
steps:
- if: github.event_name == 'push'
run: |-
gh release create "${{ github.ref_name }}" --target "${{ github.sha }}"
build:
name: Build
runs-on: ubuntu-latest
needs: [ prepare-release ]
strategy:
matrix:
goos: [ linux ]
goarch: [ amd64, arm64 ]
steps:
- uses: actions/checkout@v4
- name: Extract k6 version from go.mod
id: version
run: |-
k6version=$(grep -e go.k6.io go.mod | cut -d' ' -f 2)
echo "Detected k6 version: ${k6version}"
echo "k6=${k6version}" >> $GITHUB_OUTPUT
- name: Build with xk6
run: |-
docker run --rm -i -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" \
-e "GOOS=${{ matrix.goos }}" -e "GOARCH=${{ matrix.goarch }}" \
grafana/xk6 build ${{ steps.version.outputs.k6 }} \
--output "dist/sm-k6-${{ matrix.goos }}-${{ matrix.goarch }}" \
--with sm=.
- name: Upload artifact to release
if: github.event_name == 'push'
run: |-
gh release upload "${{ github.ref_name }}" dist/*