-
Notifications
You must be signed in to change notification settings - Fork 18
78 lines (75 loc) · 2.59 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
name: Build and release GatewayD
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
cache: true
- name: Install nfpm for building Linux packages
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Build and release binaries
run: make build-release
- name: Build and release Linux packages
run: make build-linux-packages
- name: Sign in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Sign in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
gatewaydio/gatewayd:${{ github.ref_name }}
gatewaydio/gatewayd:latest
ghcr.io/gatewayd-io/gatewayd:${{ github.ref_name }}
ghcr.io/gatewayd-io/gatewayd:latest
platforms: linux/amd64
- name: Scan Docker image with Syft and generate SBOM
run: |
go install github.com/anchore/syft/cmd/syft@latest
syft packages docker:gatewaydio/gatewayd:${{ github.ref_name }} --file gatewayd-image-${{ github.ref_name }}.cyclonedx.json --output cyclonedx-json
- name: Scan source code and generate SBOM
run: |
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest
cyclonedx-gomod mod -json -licenses -output gatewayd-source-${{ github.ref_name }}.cyclonedx.json
- name: Create release and add artifacts
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.tar.gz
dist/checksums.txt
dist/*.deb
dist/*.rpm
dist/*.zip
gatewayd-image-${{ github.ref_name }}.cyclonedx.json
gatewayd-source-${{ github.ref_name }}.cyclonedx.json
draft: false
prerelease: false
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generate_release_notes: true