Skip to content

Commit 6f880ae

Browse files
rbarker-devPSanetraandrewb1269hg
authored
chore: Update git-semver to use latest from PSANETRA (#7)
Signed-off-by: Roger Barker <[email protected]> Signed-off-by: Roger Barker <[email protected]> Signed-off-by: Andrew Brandt <[email protected]> Co-authored-by: PSanetra <[email protected]> Co-authored-by: Andrew Brandt <[email protected]>
1 parent 5cd5eff commit 6f880ae

File tree

29 files changed

+245
-209
lines changed

29 files changed

+245
-209
lines changed

.github/workflows/main.yaml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Release
2+
on:
3+
workflow_run:
4+
workflows: ["Tests"]
5+
branches: ["master", "main"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
version:
14+
name: Gather version information
15+
runs-on: ubuntu-latest
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
18+
outputs:
19+
latest_version: ${{ steps.latest_version.outputs.version }}
20+
next_version: ${{ steps.next_version.outputs.version }}
21+
22+
steps:
23+
- name: Checkout Code
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
with:
26+
fetch-depth: 0
27+
ref: ${{ github.ref }}
28+
29+
- name: Setup git-semver
30+
uses: PandasWhoCode/setup-git-semver@b6b17c8e4e6b307d2a66fd93797a9d30e48836e1 # v1.0.4
31+
with:
32+
version: latest
33+
34+
- name: Latest version
35+
id: latest_version
36+
run: echo "version=$(git-semver --latest-version)" >> "${GITHUB_OUTPUT}"
37+
38+
- name: Next version
39+
id: next_version
40+
run: echo "version=$(git-semver --next-version)" >> "${GITHUB_OUTPUT}"
41+
42+
release:
43+
name: Release
44+
needs: version
45+
if: ${{ needs.version.outputs.latest_version != needs.version.outputs.next_version }}
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Checkout Code
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
with:
51+
fetch-depth: 0
52+
ref: ${{ github.ref }}
53+
54+
- name: Setup git-semver
55+
uses: PandasWhoCode/setup-git-semver@b6b17c8e4e6b307d2a66fd93797a9d30e48836e1 # v1.0.4
56+
with:
57+
version: latest
58+
59+
- name: Generate Changelog
60+
id: generate_changelog
61+
env:
62+
VERSION=${{ needs.version.outputs.next_version }}
63+
run: |
64+
changelog=$(git-semver log --markdown "${VERSION}")
65+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
66+
67+
- name: Create Release
68+
id: create_release
69+
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
with:
73+
tag_name: v${{ needs.version.outputs.next_version }}
74+
release_name: Release ${{ needs.version.outputs.next_version }}
75+
body: |
76+
${{ steps.generate_changelog.outputs.changelog }}
77+
draft: false # Tag must be published before gitreleaser is executed
78+
prerelease: false

.github/workflows/tests.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tests
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- "master"
8+
- "main"
9+
pull_request:
10+
branches:
11+
- "master"
12+
- "main"
13+
14+
jobs:
15+
unit_tests:
16+
name: Unit Tests
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Code
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
ref: ${{ github.ref }}
23+
24+
- name: Setup Go
25+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
26+
with:
27+
go-version: '^1.24.1'
28+
- run: go test ./...
29+
30+
integration_tests:
31+
name: Integration Tests
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout Code
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
with:
37+
ref: ${{ github.ref }}
38+
39+
- name: Setup Java
40+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
41+
with:
42+
java-version: '21'
43+
distribution: 'temurin'
44+
cache: 'maven'
45+
46+
- name: Run Tests
47+
run: cd integration_tests && mvn verify

.goreleaser.yaml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1+
version: 2
12
project_name: git-semver
2-
before:
3-
hooks:
4-
# You may remove this if you don't use go modules.
5-
- go mod tidy
6-
# you may remove this if you don't need go generate
7-
- go generate ./...
83
builds:
94
- main: ./cli/main.go
105
goos:
@@ -19,17 +14,8 @@ builds:
1914
ignore:
2015
- goos: windows
2116
goarch: arm64
22-
checksum:
23-
name_template: 'checksums.txt'
2417
snapshot:
2518
name_template: "{{ incpatch .Version }}-next"
26-
changelog:
27-
skip: true
28-
release:
29-
github:
30-
owner: PSanetra
31-
name: git-semver
32-
mode: keep-existing
3319
dockers:
3420
- image_templates:
3521
- "psanetra/git-semver:latest"
@@ -41,7 +27,15 @@ dockers:
4127
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
4228
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
4329
- "--label=org.opencontainers.image.version={{ .Version }}"
44-
30+
checksum:
31+
name_template: 'checksums.txt'
32+
changelog:
33+
disable: true
34+
release:
35+
github:
36+
owner: PSanetra
37+
name: git-semver
38+
mode: keep-existing
4539
# modelines, feel free to remove those if you don't want/use them:
4640
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
4741
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22-alpine as build
1+
FROM golang:1.24-alpine as build
22

33
WORKDIR /src
44

@@ -8,7 +8,7 @@ RUN go test -v -vet=off ./...
88

99
RUN GOOS=linux GARCH=amd64 CGO_ENABLED=0 go build -o git-semver -ldflags="-s -w" cli/main.go
1010

11-
FROM alpine:3.19
11+
FROM alpine:3.21
1212

1313
RUN apk --no-cache add git git-lfs openssh-client
1414

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# git-semver
2-
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) [![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/psanetra/git-semver)](https://hub.docker.com/r/psanetra/git-semver) [![Docker Image Pulls](https://img.shields.io/docker/pulls/psanetra/git-semver)](https://hub.docker.com/r/psanetra/git-semver)
2+
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) [![Docker Image Pulls](https://img.shields.io/docker/pulls/psanetra/git-semver)](https://hub.docker.com/r/psanetra/git-semver)
33

44
git-semver is a command line tool to calculate [semantic versions](https://semver.org/spec/v2.0.0.html) based on the git history and tags of a repository.
55

cli/compare/command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package compare
22

33
import (
4-
"github.com/andrewb1269hg/git-semver/logger"
5-
"github.com/andrewb1269hg/git-semver/semver"
4+
"github.com/PandasWhoCode/git-semver/logger"
5+
"github.com/PandasWhoCode/git-semver/semver"
66
"github.com/spf13/cobra"
77
)
88

cli/latest/command.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package latest
22

33
import (
44
"fmt"
5-
"github.com/andrewb1269hg/git-semver/cli/common_opts"
6-
"github.com/andrewb1269hg/git-semver/latest"
7-
"github.com/andrewb1269hg/git-semver/logger"
5+
"github.com/PandasWhoCode/git-semver/cli/common_opts"
6+
"github.com/PandasWhoCode/git-semver/latest"
7+
"github.com/PandasWhoCode/git-semver/logger"
88
"github.com/spf13/cobra"
99
)
1010

cli/log/command.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package log
33
import (
44
"encoding/json"
55
"fmt"
6-
"github.com/andrewb1269hg/git-semver/cli/common_opts"
7-
"github.com/andrewb1269hg/git-semver/conventional_commits"
8-
"github.com/andrewb1269hg/git-semver/logger"
9-
"github.com/andrewb1269hg/git-semver/semver"
10-
"github.com/andrewb1269hg/git-semver/version_log"
6+
"github.com/PandasWhoCode/git-semver/cli/common_opts"
7+
"github.com/PandasWhoCode/git-semver/conventional_commits"
8+
"github.com/PandasWhoCode/git-semver/logger"
9+
"github.com/PandasWhoCode/git-semver/semver"
10+
"github.com/PandasWhoCode/git-semver/version_log"
1111
"github.com/spf13/cobra"
1212
)
1313

cli/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package main
22

33
import (
4-
"github.com/andrewb1269hg/git-semver/cli/common_opts"
5-
"github.com/andrewb1269hg/git-semver/cli/compare"
6-
"github.com/andrewb1269hg/git-semver/cli/latest"
7-
"github.com/andrewb1269hg/git-semver/cli/log"
8-
"github.com/andrewb1269hg/git-semver/cli/next"
9-
"github.com/andrewb1269hg/git-semver/logger"
4+
"github.com/PandasWhoCode/git-semver/cli/common_opts"
5+
"github.com/PandasWhoCode/git-semver/cli/compare"
6+
"github.com/PandasWhoCode/git-semver/cli/latest"
7+
"github.com/PandasWhoCode/git-semver/cli/log"
8+
"github.com/PandasWhoCode/git-semver/cli/next"
9+
"github.com/PandasWhoCode/git-semver/logger"
1010
"github.com/spf13/cobra"
1111
)
1212

0 commit comments

Comments
 (0)