Debian Codegraph @

.github/workflows/release.yaml

raw
1 name: NATS Server Releases
2 on:
3 push:
4 tags:
5 - v*
6
7 permissions:
8 contents: read
9
10 jobs:
11 run:
12 name: GitHub Release
13 runs-on: ${{ vars.GHA_WORKER_RELEASE || 'ubuntu-latest' }}
14 permissions:
15 contents: write
16 steps:
17 - name: Checkout code
18 uses: actions/checkout@v6
19 with:
20 fetch-depth: 0
21 fetch-tags: true
22
23 - name: Set up Go
24 uses: actions/setup-go@v6
25 with:
26 go-version: "stable"
27
28 - name: Check version matches tag
29 env:
30 TRAVIS_TAG: ${{ github.ref_name }}
31 run: |
32 go test -race -v -run=TestVersionMatchesTag ./server -ldflags="-X=github.com/nats-io/nats-server/v2/server.serverVersion=$TRAVIS_TAG" -count=1 -vet=off
33
34 - name: Install cosign
35 # Use commit hash here to avoid a re-tagging attack, as this is a third-party action
36 # Commit 6f9f17788090df1f26f669e9d70d6ae9567deba6 = tag v4.1.2
37 uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6
38
39 - name: Install syft
40 # Use commit hash here to avoid a re-tagging attack, as this is a third-party action
41 # Commit e22c389904149dbc22b58101806040fa8d37a610 = tag v0.24.0
42 uses: anchore/sbom-action/download-syft@e22c389904149dbc22b58101806040fa8d37a610
43 with:
44 syft-version: "v1.42.3"
45
46 - name: Create release
47 uses: goreleaser/goreleaser-action@v7
48 with:
49 distribution: goreleaser
50 version: "~> v2"
51 args: release --clean
52 env:
53 GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }}
54 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}