Skip to content

Commit 8f64b57

Browse files
committed
Fix goreleaser
1 parent 13ec2f7 commit 8f64b57

File tree

2 files changed

+27
-110
lines changed

2 files changed

+27
-110
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -8,125 +8,45 @@ on:
88
permissions:
99
contents: write
1010

11-
env:
12-
# renovate: datasource=go depName=github.com/goreleaser/goreleaser
13-
GORELEASER_VERSION: v1.10.2
14-
1511
jobs:
1612
binaries:
1713
name: Goreleaser release
1814
runs-on: ubuntu-latest
1915
if: startsWith(github.ref, 'refs/tags/')
20-
container:
21-
image: docker.io/goreleaser/goreleaser-cross:v1.18.3
22-
options: --privileged
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2516
steps:
26-
- name: Check out the code
27-
uses: actions/checkout@v6
17+
- name: Checkout
18+
uses: actions/checkout@v4
2819
with:
2920
fetch-depth: 0
3021

3122
- name: Set up Go
32-
uses: actions/setup-go@v6
23+
uses: actions/setup-go@v5
3324
with:
3425
go-version-file: 'go.mod'
35-
cache: true
36-
37-
- name: Fetch all tags
38-
run: git fetch --force --tags
3926

40-
- name: Run Goreleaser
41-
run: goreleaser release --rm-dist --debug
27+
- name: Run GoReleaser
28+
uses: goreleaser/goreleaser-action@v6
29+
with:
30+
distribution: goreleaser
31+
args: release --clean
4232
env:
4333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4434

4535
- name: Archive generated artifacts
46-
uses: actions/upload-artifact@v5
36+
uses: actions/upload-artifact@v4
4737
with:
48-
name: parca-push-dist-release
38+
name: parca-debuginfo-dist-release
4939
if-no-files-found: error
5040
path: |
51-
goreleaser/dist
52-
!goreleaser/dist/*.txt
41+
dist/
5342
5443
docs:
5544
name: Publish Docs
5645
runs-on: ubuntu-latest
5746
needs: binaries
5847
steps:
59-
uses: actions/checkout@v6
48+
- uses: actions/checkout@v4
6049

6150
- name: Publish Vercel
6251
run: |
6352
curl -X POST "https://api.vercel.com/v1/integrations/deploy/${{ secrets.VERCEL_WEBHOOK }}"
64-
65-
container:
66-
name: Build and release container images
67-
runs-on: ubuntu-latest
68-
needs: binaries
69-
container:
70-
# https://github.com/containers/podman/tree/main/contrib/podmanimage
71-
# Specifying SHA repeatedly fails:
72-
# @sha256:421ac576cebff98e90c531e7b9ce4482370ecc7cee59abc2341714031bfb5f43
73-
image: quay.io/containers/podman:v4.1.1
74-
options: >-
75-
--device /dev/fuse:rw
76-
--privileged
77-
--security-opt label=disable
78-
--security-opt seccomp=unconfined
79-
permissions:
80-
id-token: write
81-
packages: write
82-
contents: read
83-
steps:
84-
- name: Install dependencies
85-
run: dnf install --assumeyes --repo fedora git make jq
86-
87-
- name: Check out code into the Go module directory
88-
uses: actions/checkout@v6
89-
90-
- name: Set up Go
91-
uses: actions/setup-go@v6
92-
with:
93-
go-version-file: 'go.mod'
94-
check-latest: true
95-
96-
- name: Get branch name
97-
shell: bash
98-
run: echo "GITHUB_BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
99-
100-
- uses: actions/download-artifact@v6
101-
with:
102-
name: parca-push-dist-release
103-
path: goreleaser/dist
104-
105-
- name: Build container
106-
run: make container
107-
108-
- name: Check images are created
109-
run: podman images | grep 'ghcr.io/parca-dev/parca-push'
110-
111-
- name: Login to registry
112-
if: ${{ github.event_name != 'pull_request' }}
113-
run: |
114-
echo "${{ secrets.PERSONAL_ACCESS_TOKEN }}" | podman login -u parca-dev --password-stdin ghcr.io
115-
116-
- name: Install cosign
117-
uses: sigstore/cosign-installer@09a077b27eb1310dcfb21981bee195b30ce09de0 # tag=v2.5.0
118-
119-
- name: Install crane
120-
if: ${{ github.event_name != 'pull_request' }}
121-
uses: imjasonh/setup-crane@e82f1b9a8007d399333baba4d75915558e9fb6a4 # tag=v0.2
122-
123-
- name: Push container
124-
if: ${{ github.event_name != 'pull_request' }}
125-
run: |
126-
make push-container
127-
128-
- name: Sign container
129-
env:
130-
COSIGN_EXPERIMENTAL: true
131-
run: |
132-
make sign-container

.goreleaser.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
# NOTICE: This file is written with the assumption that it will be used in parca-dev/cross-builder.
2-
# - There are paths in this file that are specific to parca-dev/cross-builder and Github Actions.
3-
# - Unfortunately, Goreleaser does not support templating environment variables per build config.
4-
project_name: parca-push
5-
dist: ./goreleaser/dist
6-
before:
7-
hooks:
8-
- go mod tidy
1+
version: 2
92
builds:
103
- main: ./cmd/parca-push/
114
id: "parca-push"
@@ -28,25 +21,29 @@ builds:
2821
# {{.CommitDate}} is the date of the commit to make builds reproducible.
2922
- -X main.version={{.Version}} -X main.commit={{.FullCommit}} -X main.date={{.CommitDate}} -X main.goArch={{.Runtime.Goarch}}
3023
archives:
31-
- replacements:
32-
linux: Linux
33-
darwin: Darwin
34-
amd64: x86_64
24+
- name_template: >-
25+
{{ .ProjectName }}_
26+
{{- trimprefix .Version "v" }}_
27+
{{- title .Os }}_
28+
{{- if eq .Arch "amd64_v1" }}x86_64
29+
{{- else if eq .Arch "arm64_v8.0" }}aarch64
30+
{{- else }}{{ .Arch }}{{ end }}
31+
format: binary
3532
format_overrides:
3633
- goos: windows
3734
format: zip
3835
checksum:
3936
name_template: 'checksums.txt'
4037
snapshot:
41-
name_template: "{{ incpatch .Tag }}-next"
38+
version_template: "{{ incpatch .Tag }}-next"
4239
release:
40+
github:
41+
owner: parca-dev
42+
name: parca-push
4343
prerelease: auto
44-
# Defaults to empty.
44+
draft: false
45+
name_template: '{{ .Tag }}'
4546
footer: |
46-
## Docker images
47-
48-
`docker pull ghcr.io/parca-dev/parca-push:{{ .Tag }}`
49-
5047
## Thanks!
5148
5249
Join our [Discord server](https://discord.com/invite/ZgUpYgpzXy);

0 commit comments

Comments
 (0)