-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (77 loc) · 2.52 KB
/
enterprise-release.yaml
File metadata and controls
91 lines (77 loc) · 2.52 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: enterprise-release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
snapshot:
description: Force a dev version to be generated, implies dry_run.
type: boolean
required: true
dry_run:
description: Perform a dry-run release.
type: boolean
required: true
permissions:
# Required to publish a release
contents: write
# Necessary to push docker images to ghcr.io.
packages: write
env:
CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }}
jobs:
release:
runs-on: ubuntu-latest
env:
# Necessary for Docker manifest
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# If the event that triggered the build was an annotated tag (which our
# tags are supposed to be), actions/checkout has a bug where the tag in
# question is only a lightweight tag and not a full annotated tag. This
# command seems to fix it.
# https://github.com/actions/checkout/issues/290
- name: Fetch git tags
run: git fetch --tags --force
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "^1.24.5"
- name: Build binaries
run: |
set -euxo pipefail
go mod download
version=$(./ci/scripts/version.sh)
make -j \
enterprise/build/exectrace_"$version"_linux_{amd64,arm64,armv7}
- name: Build Docker images
run: |
set -euxo pipefail
version=$(./ci/scripts/version.sh)
make -j \
enterprise/build/exectrace_"$version"_linux_{amd64,arm64,armv7}.tag
- name: Push Docker images
if: ${{ !github.event.inputs.snapshot && !github.event.inputs.dry_run }}
run: |
set -euxo pipefail
version=$(./ci/scripts/version.sh)
make -j \
enterprise/build/exectrace_"$version"_linux_{amd64,arm64,armv7}.tag.pushed
- name: Build and push multi-arch Docker image
if: ${{ !github.event.inputs.snapshot && !github.event.inputs.dry_run }}
run: |
set -euxo pipefail
version=$(./ci/scripts/version.sh)
make -j \
enterprise/build/exectrace_{"$version",latest}_linux.tag.pushed