forked from open-telemetry/opentelemetry-collector-releases
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (109 loc) · 3.41 KB
/
release.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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Release
on:
push:
tags: ["v*"]
jobs:
prepare:
strategy:
matrix:
GOOS: [linux, windows, darwin]
GOARCH: ["386", amd64, arm64, ppc64le, arm]
exclude:
- GOOS: darwin
GOARCH: "386"
- GOOS: windows
GOARCH: arm64
- GOOS: darwin
GOARCH: arm
- GOOS: windows
GOARCH: arm
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: sigstore/cosign-installer@v2
- uses: docker/setup-qemu-action@v2
with:
platforms: arm64,ppc64le,linux/arm/v7
- uses: docker/setup-buildx-action@v2
- uses: actions/setup-go@v4
with:
go-version: '~1.21'
check-latest: true
- name: Generate distribution sources
run: make generate-sources
- name: Log into Docker.io
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Package Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- uses: goreleaser/goreleaser-action@v4
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit
with:
distribution: goreleaser-pro
version: latest
args: release --clean --split --timeout 2h
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
COSIGN_EXPERIMENTAL: true
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- uses: actions/upload-artifact@v3
with:
name: all-artifacts
path: dist/*/*
release:
name: Release
runs-on: ubuntu-20.04
needs: prepare
permissions:
id-token: write
packages: write
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: sigstore/cosign-installer@v2
- uses: anchore/sbom-action/[email protected]
- uses: docker/setup-qemu-action@v2
with:
platforms: arm64,ppc64le
- uses: docker/setup-buildx-action@v2
- uses: actions/setup-go@v4
with:
go-version: '~1.21'
check-latest: true
- uses: actions/download-artifact@v3
with:
name: all-artifacts
path: dist
- name: Log into Docker.io
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Login to GitHub Package Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v4
if: steps.cache.outputs.cache-hit != 'true' # do not run if cache hit
with:
distribution: goreleaser-pro
version: latest
args: continue --merge --timeout 2h
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_EXPERIMENTAL: true
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}