Skip to content

Commit 5ccc83b

Browse files
committed
ci: add more release workflow + minor updates
1 parent 3c4c209 commit 5ccc83b

File tree

6 files changed

+165
-1
lines changed

6 files changed

+165
-1
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
day: sunday
8+
time: "05:00"
9+
timezone: "Europe/Lisbon"
10+
open-pull-requests-limit: 5
11+
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: weekly
16+
day: sunday
17+
time: "05:30"
18+
timezone: "Europe/Lisbon"
19+
open-pull-requests-limit: 5

.github/release-drafter.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name-template: "v$RESOLVED_VERSION"
2+
tag-template: "v$RESOLVED_VERSION"
3+
4+
# Sugerimos next patch por omissão; podes mudar para $NEXT_MINOR_VERSION
5+
version-resolver:
6+
major:
7+
labels: ["major"]
8+
minor:
9+
labels: ["minor", "feature", "enhancement"]
10+
patch:
11+
labels: ["patch", "bug", "fix", "chore", "docs", "internal"]
12+
default: patch
13+
14+
categories:
15+
- title: "✨ Novidades"
16+
labels: ["feature", "enhancement"]
17+
- title: "🐛 Correções"
18+
labels: ["bug", "fix"]
19+
- title: "🧹 Chores / Interno"
20+
labels: ["chore", "internal", "refactor"]
21+
- title: "📝 Docs"
22+
labels: ["docs"]
23+
- title: "🛡️ Segurança"
24+
labels: ["security"]
25+
26+
change-template: "- $TITLE (#$NUMBER) by @$AUTHOR"
27+
no-changes-template: "_Sem alterações categorizadas_"
28+
29+
template: |
30+
## 🚀 Release $RESOLVED_VERSION
31+
32+
$CHANGES
33+
34+
### 📦 Notas
35+
- Versão Go recomendada: **1.22+**
36+
- Binários e checksums estão na página da release.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
types: [opened, reopened, synchronize, labeled, unlabeled, closed]
8+
branches: [ main ]
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
update_release_draft:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: release-drafter/release-drafter@v6
18+
with:
19+
config-name: release-drafter.yml
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/status.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
tags-ignore: ["**"] # as releases por tag já estão noutro workflow
7+
pull_request:
8+
branches: ["**"]
9+
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build-lint-test:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: "1.22.x"
29+
cache: true
30+
31+
- name: Go env
32+
run: go env
33+
34+
- name: Download deps
35+
run: go mod download
36+
37+
- name: Build (all pkgs)
38+
run: go build ./...
39+
40+
- name: Vet
41+
run: go vet ./...
42+
43+
- name: Lint (golangci-lint)
44+
uses: golangci/golangci-lint-action@v6
45+
with:
46+
version: latest
47+
args: >
48+
--timeout=5m
49+
--out-format=colored-line-number
50+
only-new-issues: false
51+
52+
- name: Security scan (govulncheck)
53+
uses: golang/govulncheck-action@v1
54+
with:
55+
go-version-input: "1.22.x"
56+
args: "./..."
57+
58+
- name: Test
59+
run: go test -race -count=1 ./...

Readme.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# sharepoint-client
22

3+
[![Release](https://img.shields.io/github/v/release/vba-excel/sharepoint-go?logo=github&sort=semver)](https://github.com/vba-excel/sharepoint-go/releases/latest)
4+
[![Build](https://github.com/vba-excel/sharepoint-go/actions/workflows/release.yml/badge.svg)](https://github.com/vba-excel/sharepoint-go/actions/workflows/release.yml)
5+
[![Go](https://img.shields.io/badge/Go-1.22%2B-00ADD8)](https://go.dev/dl/)
6+
7+
> **Downloads & integridade**
8+
>
9+
> - Binários prontos: ver a secção **Releases** do GitHub.
10+
> - Cada release inclui um ficheiro `checksums_<versão>.txt` com os SHA‑256 de todos os artefactos.
11+
>
12+
> **Verificar no Linux/macOS**
13+
> ```bash
14+
> # Exemplo para a versão vX.Y.Z
15+
> VER="vX.Y.Z"
16+
> curl -sL "https://github.com/vba-excel/sharepoint-go/releases/download/${VER}/checksums_${VER}.txt" -o checksums.txt
17+
> sha256sum -c checksums.txt # deve dizer OK para o(s) ficheiro(s) que tens localmente
18+
> ```
19+
>
20+
> **Verificar no Windows (PowerShell)**
21+
> ```powershell
22+
> $ver = 'vX.Y.Z'
23+
> $zip = "sharepoint-client_$ver_windows_amd64.zip"
24+
> $expected = (Invoke-WebRequest -UseBasicParsing "https://github.com/vba-excel/sharepoint-go/releases/download/$ver/checksums_$ver.txt").Content |
25+
> Select-String $zip | ForEach-Object { ($_ -split ' ')[0] }
26+
> $actual = (Get-FileHash $zip -Algorithm SHA256).Hash.ToLower()
27+
> if ($actual -eq $expected) { "OK: $zip" } else { "FALHOU: $zip`nexpected=$expected`nactual =$actual"; exit 1 }
28+
> ```
29+
30+
#
31+
332
`sharepoint-client` é um utilitário de linha de comandos em Go para ler e escrever listas do SharePoint Online, com tolerância a throttling, paginação automática e formatos de saída pensados para pipelines (`json`, `jsonl`, `csv`).
433
534
Funciona bem com:

cmd/sharepoint-client/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
// Nome e versão por omissão (podem ser sobrepostos por ldflags no build)
2727
const appName = "sharepoint-client"
28-
const defaultVersion = "v1.0.4"
28+
const defaultVersion = "v1.0.5"
2929

3030
// Estes três são **injetados** pelo build (ldflags -X main.buildVersion=... etc.)
3131
// Valores de fallback para execuções locais (go run / go build sem ldflags).

0 commit comments

Comments
 (0)