-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (62 loc) · 2.42 KB
/
release.yaml
File metadata and controls
71 lines (62 loc) · 2.42 KB
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
---
name: Tag and Release
on:
push:
branches:
- main
permissions:
contents: write
issues: write
pull-requests: write
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
attestations: write # needed for provenance
jobs:
release:
runs-on: ubuntu-latest
container:
image: ghcr.io/goreleaser/goreleaser-cross:v1.24.1
steps:
- name: Act Workaround # https://github.com/nektos/act/issues/973
if: ${{ env.ACT }}
run: curl -fsSL https://deb.nodesource.com/setup_22.x | bash && apt install -y nodejs
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Workaround Git Security Warning
run: |
# Workaround a bug in github actions:
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Generate templ code
uses: capthiron/templ-generator-action@v1
with:
setup-go: "false"
commit: "false"
- name: install cosign
uses: sigstore/cosign-installer@main
- name: install Syft
uses: anchore/sbom-action/download-syft@v0.18.0
- name: Check GoReleaser configuration
run: |
goreleaser check
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install semantic-release
run: |
npm install --global semantic-release conventional-changelog-conventionalcommits @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github @semantic-release/exec
- name: Configure semantic-release
run: |
# shellcheck disable=SC2016
echo '{"preset":"conventionalcommits","plugins":[["@semantic-release/commit-analyzer"],["@semantic-release/release-notes-generator"],["@semantic-release/github"],["@semantic-release/exec",{"publishCmd":"echo \"${nextRelease.notes}\" > /tmp/release-notes.md && goreleaser release --release-notes /tmp/release-notes.md --clean"}]]}' > .releaserc.json
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
run: |
semantic-release