-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README.md; Add release scripts
- Loading branch information
Showing
5 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# DEV Notes | ||
|
||
## How to release a new version | ||
|
||
Before create a new version please update the CHANGELOG.md. | ||
|
||
```bash | ||
bash dev/scripts/release.sh 1.0.0 | ||
``` | ||
|
||
This will trigger a CI/CD pipeline where it will: | ||
|
||
* Build & packaging the JDK library and CLI | ||
* Build & deploy a docker image | ||
* Create a draft GitHub release | ||
|
||
After the pipeline ends please do the following step: | ||
|
||
* Update the draft GitHub release | ||
* Run the prepare next version script | ||
|
||
```bash | ||
bash dev/scripts/prepare-next-release.sh 1.1.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
# commons-ip-cits-siard | ||
|
||
Tool and Java Library to support creation and validation of E-ARK SIP following CITS SIARD specification | ||
A Command line interface (CLI) and Java Library to support creation and validation of E-ARK SIP following CITS SIARD specification | ||
|
||
[![GitHub latest release](https://img.shields.io/github/v/release/keeps/commons-ip-cits-siard?sort=semver&color=informational)](https://github.com/keeps/commons-ip-cits-siard/releases/latest) | ||
![GitHub downloads](https://img.shields.io/github/downloads/keeps/commons-ip-cits-siard/total) | ||
[![GitHub contributors](https://img.shields.io/github/contributors/keeps/commons-ip-cits-siard)](https://github.com/keeps/commons-ip-cits-siard/graphs/contributors) | ||
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/keeps/commons-ip-cits-siard) | ||
<!-- {% comment %} --> | ||
[![testing](https://github.com/keeps/commons-ip-cits-siard/actions/workflows/CI.yml/badge.svg)](https://github.com/keeps/commons-ip-cits-siard/actions/workflows/CI.yml?label=testing) | ||
<!-- {% endcomment %}--> | ||
|
||
> [!WARNING] | ||
> Currently being developed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
|
||
REGEX="([0-9]+).([0-9]+).([0-9]+)" | ||
|
||
if [[ $VERSION =~ $REGEX ]]; then | ||
MAJOR="${BASH_REMATCH[1]}" | ||
MINOR="${BASH_REMATCH[2]}" | ||
fi | ||
|
||
MINOR=$((MINOR + 1)) | ||
BUILD="0" | ||
|
||
SNAPSHOT_VERSION="${MAJOR}.${MINOR}.${BUILD}-SNAPSHOT" | ||
|
||
cat <<EOF | ||
################################ | ||
# Prepare for next version | ||
################################ | ||
EOF | ||
|
||
echo "Update version to $SNAPSHOT_VERSION" | ||
|
||
mvn versions:set versions:commit -DnewVersion="$SNAPSHOT_VERSION" | ||
|
||
git add pom.xml | ||
git commit -S -m "Setting version $SNAPSHOT_VERSION" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
release() { | ||
|
||
cat <<EOF | ||
################################ | ||
# Release version | ||
################################ | ||
EOF | ||
RELEASE_VERSION=$1 | ||
RELEASE_TAG="$RELEASE_VERSION" | ||
# Ensure all classes have license header | ||
mvn license:format | ||
|
||
# Updating Maven modules | ||
mvn versions:set versions:commit -DnewVersion="$RELEASE_VERSION" | ||
|
||
# Commit Maven version update | ||
git add -u | ||
git commit -S -m "Release version $RELEASE_VERSION" | ||
|
||
# Create tag | ||
git tag -s -a "$RELEASE_TAG" -m "Version $RELEASE_VERSION" | ||
|
||
# Push tag | ||
git push origin "$RELEASE_TAG" | ||
|
||
return 0 | ||
} | ||
|
||
# Check if an argument was passed | ||
if [ $# -eq 0 ]; then | ||
echo "No arguments provided." | ||
echo "Usage: $0 <version>" | ||
echo "Example: $0 2.5.0" | ||
exit 1 | ||
else | ||
regex="([0-9]+).([0-9]+).([0-9]+)" | ||
if [[ $1 =~ $regex ]]; then | ||
read -p "Did you update the CHANGELOG.md? (yes/no): " answer | ||
case $answer in | ||
[Yy]*) release "$1" ;; | ||
[Nn]*) | ||
echo "Update the CHANGELOG.md before release a new version" | ||
exit 1 | ||
;; | ||
*) echo "Please answer yes or no." ;; | ||
esac | ||
else | ||
echo "Please provide a version that follows semantic versioning syntax" | ||
exit 1 | ||
fi | ||
fi |