Skip to content

Commit 931e62f

Browse files
committed
Added goreleaser
1 parent 9932650 commit 931e62f

8 files changed

+102
-24
lines changed
+19-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
name: Build and Release binary
1+
name: Build and release binary
22

33
on:
4-
schedule:
5-
- cron: "30 1 * * *"
4+
push:
5+
tags:
6+
- '*'
67

78
jobs:
89
build-release-binary:
910
runs-on: ubuntu-latest
1011

12+
permissions:
13+
contents: write
14+
1115
steps:
12-
- uses: actions/checkout@v4
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
1318

14-
- name: Build Verdex binary
15-
run: |
16-
go mod download
17-
go build -ldflags "-X github.com/verdexlab/verdex/verdex/core.releaseEnvironment=release-binary" -o verdex-binary
19+
- name: Setup Go environment
20+
uses: actions/setup-go@v5
1821

19-
- name: Store Verdex binary
20-
run: |
21-
# TODO
22+
- name: Build and release binary
23+
uses: goreleaser/goreleaser-action@v6
24+
with:
25+
distribution: goreleaser
26+
version: '~> v2'
27+
args: release --clean
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Create CLI release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
create-cli-release:
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
contents: write
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Determine release version
18+
run: echo "VERDEX_VERSION=$(awk '/cliVersion/{print $4}' verdex/core/config.go | sed -e 's/\"//g')" >> $GITHUB_ENV
19+
20+
- name: Create tag
21+
run: |
22+
git config user.name github-actions
23+
git config user.email github-actions@github.com
24+
git tag "v$VERDEX_VERSION"
25+
git push --tags

.github/workflows/update-products-votes.yml

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
name: Update Products Votes
1+
name: Update products votes
22

33
on:
44
schedule:
5-
- cron: "30 1 * * *"
5+
- cron: "30 1 * * *"
6+
workflow_dispatch:
67

78
jobs:
89
update-products-votes:
@@ -12,15 +13,21 @@ jobs:
1213
contents: write
1314

1415
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-python@v4
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python environment
20+
uses: actions/setup-python@v4
1721
with:
1822
python-version: 3.8
1923

20-
- name: Update Products Votes
24+
- name: Install dependencies
25+
run: pip install requests
26+
27+
- name: Update products votes
2128
run: python3 scripts/update-products-votes.py
2229

23-
- name: Git Commit & Push
30+
- name: Git commit & push
2431
run: |
2532
git config user.name github-actions
2633
git config user.email github-actions@github.com

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ output.json
66
# Templates Caches
77
.versions.cache
88
.cache
9+
10+
# Build
11+
dist/

.goreleaser.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
7+
builds:
8+
- id: verdex-cli
9+
binary: verdex
10+
11+
env:
12+
- CGO_ENABLED=0
13+
14+
goos: [windows,linux,darwin]
15+
goarch: [amd64,386,arm,arm64]
16+
ignore:
17+
- goos: darwin
18+
goarch: 386
19+
- goos: windows
20+
goarch: arm
21+
- goos: windows
22+
goarch: arm64
23+
24+
ldflags:
25+
- -X github.com/verdexlab/verdex/verdex/core.releaseEnvironment=release-binary
26+
27+
archives:
28+
- format: zip
29+
id: verdex
30+
builds: [verdex-cli]
31+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}'
32+
33+
checksum:
34+
algorithm: sha256

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ minimum version of the service** (see [How It Works](/how-it-works) for more inf
1313
🎯 Currently, Verdex supports detecting versions of **Keycloak** and **NextCloud** (see [Products](/essentials/products) documentation).
1414

1515
## 📖 Documentation
16-
The entire tool documentation is available at:
17-
[https://verdex-docs.mintlify.app](https://verdex-docs.mintlify.app)
16+
The entire tool documentation is available at [https://verdex-docs.mintlify.app](https://verdex-docs.mintlify.app)
1817

1918
## 🚀 Install Verdex
2019

@@ -29,15 +28,17 @@ echo 'alias verdex="docker run --rm verdexlab/verdex:latest"' >> ~/.bashrc
2928
source ~/.bashrc
3029
```
3130

32-
> 📖 Read documentation for more installation options: [https://verdex-docs.mintlify.app](https://verdex-docs.mintlify.app)
31+
> 📖 Read documentation for more installation options:
32+
[https://verdex-docs.mintlify.app/quickstart](https://verdex-docs.mintlify.app/quickstart)
3333

3434
## 🌪️ Run version detection
3535

3636
```bash
3737
verdex -target https://keycloak.example.com -output-json ./results.json
3838
```
3939

40-
> 📖 Read documentation for more detection options: [https://verdex-docs.mintlify.app](https://verdex-docs.mintlify.app)
40+
> 📖 Read documentation for more detection options:
41+
[https://verdex-docs.mintlify.app/essentials/options](https://verdex-docs.mintlify.app/essentials/options)
4142

4243
## License
4344
Verdex is distributed under MIT License.

docs/quickstart.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ description: 'Learn how to run first Verdex detections in seconds.'
3030

3131
<Tab title="Binary">
3232
Download the latest binary from official releases:
33-
[https://github.com/verdexlab/verdex/releases?q=cli-&expanded=true](https://github.com/verdexlab/verdex/releases?q=cli-&expanded=true)
33+
[https://github.com/verdexlab/verdex/releases?q=v&expanded=true](https://github.com/verdexlab/verdex/releases?q=v&expanded=true)
3434
</Tab>
3535
</Tabs>
3636
</Step>

verdex/core/update.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"github.com/verdexlab/verdex/verdex/thirdparty"
1010
)
1111

12-
var cliReleasesPrefix = "cli-"
13-
var cliReleasesUrl = "https://github.com/verdexlab/verdex/releases?q=cli-&expanded=true"
12+
var cliReleasesPrefix = "v"
13+
var cliReleasesUrl = "https://github.com/verdexlab/verdex/releases?q=v&expanded=true"
1414
var cliReleaseCacheExpiration = 24 * time.Hour
1515

1616
// Check if a Verdex CLI update is available and render message

0 commit comments

Comments
 (0)