Skip to content

Commit e8fbd27

Browse files
committed
v1.0.0
1 parent 80227c6 commit e8fbd27

File tree

5 files changed

+148
-0
lines changed

5 files changed

+148
-0
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go
5+
6+
on:
7+
push:
8+
branches: [ "main", "develop" ]
9+
pull_request:
10+
branches: [ "main", "develop" ]
11+
12+
jobs:
13+
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.20'
23+
24+
- name: Build
25+
run: |
26+
cd cmd/cli
27+
go build -v ./...
28+
29+
- name: Test
30+
run: go test -v ./...

.github/workflows/gorelease.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: goreleaser
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
permissions:
7+
contents: write
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- run: git fetch --force --tags
16+
- uses: actions/setup-go@v5
17+
with:
18+
go-version: stable
19+
- name: Generate release notes
20+
continue-on-error: true
21+
run: ./scripts/release-notes.sh ${{github.ref_name}} > ${{runner.temp}}/release_notes.txt
22+
- name: Run GoReleaser
23+
uses: goreleaser/goreleaser-action@v6
24+
with:
25+
distribution: goreleaser
26+
version: "~> v2"
27+
args: release --clean --release-notes=${{runner.temp}}/release_notes.txt
28+
workdir: app
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
6+
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### [v1.0.0]
11+
12+
- CLI application for automating the OpenMVG and OpenMVS pipeline
13+
- Library coming soon

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Sam Laister
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

scripts/release-notes.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# Check if the required argument is provided
6+
if [ $# -lt 1 ]; then
7+
echo "Usage: $0 <semver version> [<changelog file>]"
8+
exit 1
9+
fi
10+
11+
version="$1"
12+
changelog_file="${2:-CHANGELOG.md}"
13+
14+
# Check if the changelog file exists
15+
if [ ! -f "$changelog_file" ]; then
16+
echo "Error: $changelog_file does not exist"
17+
exit 1
18+
fi
19+
20+
CAPTURE=0
21+
items=""
22+
# Read the changelog file line by line
23+
while IFS= read -r LINE; do
24+
# Stop capturing when we reach the next version sections
25+
if [[ "${LINE}" == "##"* ]] && [[ "${CAPTURE}" -eq 1 ]]; then
26+
break
27+
fi
28+
# Stop capturing when we reach the Unreleased section
29+
if [[ "${LINE}" == "[Unreleased]"* ]]; then
30+
break
31+
fi
32+
# Start capturing when we reach the specified version section
33+
if [[ "${LINE}" == "## [${version}]"* ]] && [[ "${CAPTURE}" -eq 0 ]]; then
34+
CAPTURE=1
35+
continue
36+
fi
37+
# Capture the lines between the specified version and the next version
38+
if [[ "${CAPTURE}" -eq 1 ]]; then
39+
# Ignore empty lines
40+
if [[ -z "${LINE}" ]]; then
41+
continue
42+
fi
43+
items+="$(echo "${LINE}" | xargs -0)"
44+
# Add a newline between each item
45+
if [[ -n "$items" ]]; then
46+
items+=$'\n'
47+
fi
48+
fi
49+
done <"${changelog_file}"
50+
51+
if [[ -n "$items" ]]; then
52+
echo "${items%$'\n'}"
53+
else
54+
echo "No changelog items found for version $version"
55+
fi

0 commit comments

Comments
 (0)