-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (45 loc) · 1.67 KB
/
release.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
name: Build and Release Transformer
on:
push:
tags:
- 'v*' # Trigger the workflow when a tag matching 'v*' is pushed
workflow_dispatch: # Allows manual triggering
jobs:
build-and-release:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, darwin, windows] # Target operating systems
arch: [amd64, arm64] # Target architectures
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
cache: false
go-version-file: killercoda/tools/transformer/go.mod
- name: Build transformer
working-directory: ./tools/transformer
run: |
mkdir -p ../../release
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ../../release/transformer-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: transformer-${{ matrix.os }}-${{ matrix.arch }}
path: release/transformer-${{ matrix.os }}-${{ matrix.arch }}
release:
needs: build-and-release
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: release
- name: Create GitHub Release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
with:
files: release/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}