Skip to content

Commit 46fc587

Browse files
harisolovromazgon
andauthored
Generate connector.yaml (#96)
* Upgrade SDK to v0.13, use conn-sdk-cli * go mod tidy * use readmegen * pr feedback * update summary * update readme and connector.yaml --------- Co-authored-by: Lovro Mažgon <lovro.mazgon@gmail.com>
1 parent d363123 commit 46fc587

File tree

19 files changed

+635
-502
lines changed

19 files changed

+635
-502
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ jobs:
2727
uses: golangci/golangci-lint-action@v6
2828
with:
2929
version: ${{ steps.golangci-lint-version.outputs.v }}
30-
args: --timeout=2m

.github/workflows/release.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: release
33
on:
44
push:
55
tags:
6-
- v*
6+
- '*'
77

88
permissions:
99
contents: write
@@ -18,6 +18,50 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21+
- name: Validate Tag Format
22+
run: |
23+
TAG=${GITHUB_REF#refs/tags/}
24+
25+
SV_REGEX="^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$"
26+
27+
if ! [[ $TAG =~ $SV_REGEX ]]; then
28+
echo "$TAG is NOT a valid tag (expected format: v<semver>)"
29+
exit 1
30+
fi
31+
32+
- name: Check Version Consistency
33+
run: |
34+
# Extract tag and remove 'v' prefix if exists
35+
TAG=${GITHUB_REF#refs/tags/}
36+
37+
# Read version from connector.yaml
38+
YAML_VERSION=$(yq e '.specification.version' connector.yaml)
39+
40+
# Compare versions
41+
if [[ "$TAG" != "$YAML_VERSION" ]]; then
42+
echo "Version mismatch detected:"
43+
echo "Git Tag: $TAG"
44+
echo "connector.yaml Version: $YAML_VERSION"
45+
exit 1
46+
fi
47+
48+
- name: Delete Invalid Tag
49+
if: failure()
50+
uses: actions/github-script@v7
51+
with:
52+
github-token: ${{secrets.GITHUB_TOKEN}}
53+
script: |
54+
const tag = context.ref.replace('refs/tags/', '')
55+
try {
56+
await github.rest.git.deleteRef({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
ref: `tags/${tag}`
60+
})
61+
} catch (error) {
62+
console.log('Error deleting tag:', error)
63+
}
64+
2165
- name: Set up Go
2266
uses: actions/setup-go@v5
2367
with:

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
run:
2+
timeout: 5m
3+
14
linters-settings:
25
gofmt:
36
simplify: false
47
govet:
5-
check-shadowing: false
8+
disable:
9+
- shadow
610
nolintlint:
711
allow-unused: false # report any unused nolint directives
812
require-explanation: true # require an explanation for nolint directives

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ test:
1212
lint:
1313
golangci-lint run
1414

15+
.PHONY: fmt
16+
fmt:
17+
gofumpt -l -w .
18+
1519
.PHONY: generate
1620
generate:
1721
go generate ./...
22+
conn-sdk-cli readmegen -w
1823

1924
.PHONY: install-tools
2025
install-tools:

0 commit comments

Comments
 (0)