-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.96 KB
/
build.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build
on:
pull_request:
branches:
- main
jobs:
build:
name: build
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go environment
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: "go.mod"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
version: v2.0.1 # renovate: datasource=custom.goreleaser depName=goreleaser packageName=goreleaser/goreleaser
args: build --single-target --snapshot --clean --output ./version
env:
GORELEASER_CURRENT_TAG: ${{ steps.draft_release.outputs.tag_name }}
- name: Version test
id: version
run: echo "output=$(./version bump 0.1.0)" >> "$GITHUB_OUTPUT"
- name: Failed
if: ${{ steps.version.outputs.output != '0.1.1' }}
run: |-
exit 1
- name: Success
if: ${{ steps.version.outputs.output == '0.1.1' }}
run: |-
exit 0
docker-build:
name: docker build
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0
- name: Build Docker image
run: VERSION=$(git rev-parse --short HEAD) make docker-build docker-build-x-platform
- name: Version test
id: version
run: |-
echo "output=$(docker run ghcr.io/version-cli/version:latest bump 0.1.0)" >> "$GITHUB_OUTPUT"
- name: Failed
if: ${{ steps.version.outputs.output != '0.1.1' }}
run: |-
exit 1
- name: Success
if: ${{ steps.version.outputs.output == '0.1.1' }}
run: |-
exit 0