-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (48 loc) · 1.47 KB
/
ci.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
name: ci
on:
push:
branches:
- main
- release/*
- snapshot/*
tags:
- v*
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.ref_name != 'main' }}
jobs:
build:
name: "go and github release"
runs-on: ubuntu-latest
permissions:
contents: write
env:
# This env is required for the docker manifest command to work
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: perses/[email protected]
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
- name: install goreleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
install-only: true
- name: Build Go binaries and docker images
run: make cross-build
- name: Publish Release and binaries
## This step will only run when a new tag is pushed.
## It will build the Go binaries and the docker images and then publish:
## - the GitHub release with the archive built
## - docker images on the different docker registry selected
if: ${{ github.event_name == 'push' && startsWith(github.ref_name, 'v') }}
run: make cross-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}