Skip to content

Commit 445783d

Browse files
authored
Merge pull request #561 from authzed/fix-goreleaser-files
chore: update goreleaser and update goreleaser files
2 parents 802742a + f324c91 commit 445783d

File tree

5 files changed

+67
-14
lines changed

5 files changed

+67
-14
lines changed

.github/workflows/lint.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,19 @@ jobs:
8080
id: "goreleaser"
8181
with:
8282
distribution: "goreleaser-pro"
83-
version: "2.3.2"
83+
# NOTE: keep in sync with goreleaser version in other job.
84+
# github actions don't allow yaml anchors.
85+
version: "v2.12.5"
8486
args: "release -f .goreleaser.docker.yml --clean --split --snapshot"
8587
env:
8688
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
8789
- name: "Obtain container image to scan"
88-
run: 'echo "IMAGE_VERSION=$(jq .version dist/linux_amd64_v1/metadata.json --raw-output)" >> $GITHUB_ENV'
90+
run: |
91+
IMAGE_VERSION=$(jq .version dist/linux_amd64/metadata.json --raw-output)
92+
if [ -z "$IMAGE_VERSION" ]; then
93+
echo "Failed to extract version from metadata.json"
94+
exit 1
95+
fi
96+
echo "IMAGE_VERSION=$IMAGE_VERSION" >> $GITHUB_ENV
8997
- name: "run trivy on release image"
9098
run: "docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image --format table --exit-code 1 --ignore-unfixed --vuln-type os,library --no-progress --severity CRITICAL,HIGH,MEDIUM authzed/zed:v${{ env.IMAGE_VERSION }}-amd64 --db-repository public.ecr.aws/aquasecurity/trivy-db --java-db-repository public.ecr.aws/aquasecurity/trivy-java-db"

.github/workflows/release-windows.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "Release for Windows"
2+
name: "Release for Windows" # TODO why is this separate from release.yaml?
33
on: # yamllint disable-line rule:truthy
44
push:
55
tags:
@@ -29,9 +29,24 @@ jobs:
2929
distribution: "goreleaser-pro"
3030
# NOTE: keep in sync with goreleaser version in other job.
3131
# github actions don't allow yaml anchors.
32-
version: "v2.3.2"
32+
version: "v2.12.5"
3333
args: "release --clean --config=.goreleaser.windows.yml"
3434
env:
3535
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
3636
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
3737
CHOCOLATEY_API_KEY: "${{ secrets.CHOCOLATEY_API_KEY }}"
38+
- name: "Notify in Slack if failure"
39+
if: "${{ failure() }}"
40+
uses: "slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a" # v2.1.1
41+
with:
42+
webhook: "${{ secrets.SLACK_BUILDS_WEBHOOK_URL }}"
43+
webhook-type: "incoming-webhook"
44+
payload: |
45+
text: "Release failure."
46+
blocks:
47+
- type: "section"
48+
text:
49+
type: "mrkdwn"
50+
text: |
51+
:x: @eng-oss Release failure. Please take a look.
52+
*Repository:* <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>

.github/workflows/release.yaml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "release"
2+
name: "Release for Docker and MacOS"
33
on:
44
push:
55
tags:
@@ -23,13 +23,28 @@ jobs:
2323
distribution: "goreleaser-pro"
2424
# NOTE: keep in sync with goreleaser version in other job.
2525
# github actions don't allow yaml anchors.
26-
version: "2.3.2"
26+
version: "v2.12.5"
2727
args: "release --clean"
2828
env:
2929
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
3030
HOMEBREW_TAP_GITHUB_TOKEN: "${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}"
3131
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
3232
GEMFURY_PUSH_TOKEN: "${{ secrets.GEMFURY_PUSH_TOKEN }}"
33+
- name: "Notify in Slack if failure"
34+
if: "${{ failure() }}"
35+
uses: "slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a" # v2.1.1
36+
with:
37+
webhook: "${{ secrets.SLACK_BUILDS_WEBHOOK_URL }}"
38+
webhook-type: "incoming-webhook"
39+
payload: |
40+
text: "Release failure."
41+
blocks:
42+
- type: "section"
43+
text:
44+
type: "mrkdwn"
45+
text: |
46+
:x: @eng-oss Release failure. Please take a look.
47+
*Repository:* <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>
3348
3449
docker:
3550
runs-on: "ubuntu-latest"
@@ -50,8 +65,23 @@ jobs:
5065
distribution: "goreleaser-pro"
5166
# NOTE: keep in sync with goreleaser version in other job.
5267
# github actions don't allow yaml anchors.
53-
version: "2.3.2"
68+
version: "v2.12.5"
5469
args: "release --config=.goreleaser.docker.yml --clean"
5570
env:
5671
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
5772
GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}"
73+
- name: "Notify in Slack if failure"
74+
if: "${{ failure() }}"
75+
uses: "slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a" # v2.1.1
76+
with:
77+
webhook: "${{ secrets.SLACK_BUILDS_WEBHOOK_URL }}"
78+
webhook-type: "incoming-webhook"
79+
payload: |
80+
text: "Release failure."
81+
blocks:
82+
- type: "section"
83+
text:
84+
type: "mrkdwn"
85+
text: |
86+
:x: @eng-oss Release failure. Please take a look.
87+
*Repository:* <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>

.goreleaser.windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ archives:
2121
- "LICENSE"
2222
format_overrides:
2323
- goos: "windows"
24-
format: "zip"
24+
formats: ["zip"]
2525

26-
chocolatey:
26+
chocolateys:
2727
- name: "zed"
2828
package_source_url: "https://github.com/authzed/zed/releases"
2929
owners: "AuthZed, Inc"

.goreleaser.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ builds:
8383

8484
archives:
8585
- id: "gnu"
86-
builds:
86+
ids:
8787
- "linux-amd64-gnu"
8888
- "linux-arm64-gnu"
8989
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}_gnu"
9090
- id: "musl"
91-
builds:
91+
ids:
9292
- "linux-amd64-musl"
9393
- "linux-arm64-musl"
9494
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}_musl"
9595
- id: "other"
96-
builds:
96+
ids:
9797
- "darwin-amd64"
9898
- "darwin-arm64"
9999
- "windows-amd64"
@@ -106,7 +106,7 @@ nfpms:
106106
description: &description "manage Authzed from your command line."
107107
license: &license "Apache 2.0"
108108
epoch: &epoch "0"
109-
builds: ["linux-amd64-gnu", "linux-arm64-gnu"]
109+
ids: ["linux-amd64-gnu", "linux-arm64-gnu"]
110110
formats: ["deb", "rpm"]
111111
- id: "musl"
112112
vendor: *vendor
@@ -115,7 +115,7 @@ nfpms:
115115
description: *description
116116
license: *license
117117
epoch: *epoch
118-
builds: ["linux-amd64-musl", "linux-arm64-musl"]
118+
ids: ["linux-amd64-musl", "linux-arm64-musl"]
119119
formats: ["apk"]
120120

121121
furies:

0 commit comments

Comments
 (0)