forked from wodby/gotpl
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 1.25 KB
/
workflow.yml
File metadata and controls
50 lines (46 loc) · 1.25 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
name: Build
on:
push:
branches:
- master
tags:
- "*"
pull_request:
jobs:
build-test-release-alpine-amd64:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
env:
GOOS: linux
GOARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v5
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: 1.25
- name: build
run: make
- name: test
# @fixme: return test for non-amd64 arch when github will add support for other architectures (arm64)
if: ${{ matrix.arch == 'amd64' }}
run: make test
- name: prepare artifact
if: startsWith(github.ref, 'refs/tags/')
run: make package
- name: Get the version
if: startsWith(github.ref, 'refs/tags/')
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: xresloader/upload-to-github-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: gotpl-*.tar.gz
overwrite: false
tags: true
draft: false
tag_name: ${{ steps.get_version.outputs.VERSION }}