Skip to content

Commit 9cb7081

Browse files
committed
chore: create snapshot version in ci for further development
1 parent c08d2c6 commit 9cb7081

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,23 @@ jobs:
2424
node-version: 16.x
2525
- name: Install dependencies
2626
run: yarn global add semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/exec conventional-changelog-metahub
27+
2728
- name: Run semantic release
2829
working-directory: frank-flow
2930
env:
3031
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
31-
run: chmod +x ./prepare-release.sh && semantic-release
32+
run: chmod +x ./prepare-release.sh && semantic-release
33+
34+
- name: Make snapshot version
35+
run: chmod +x ./prepare-snapshot.sh && ./prepare-snapshot.sh
36+
37+
- name: Setup git config
38+
run: |
39+
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
40+
git config user.name "GitHub Actions Bot"
41+
git config user.email "<>"
42+
- name: Commit
43+
run: |
44+
git add **/*.pom
45+
git commit -m "Make SNAPSHOT version [Skip CI]"
46+
git push origin master

prepare-release.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/bin/bash
22

3-
echo "Version = $1"
4-
SNAPSHOT_VERSION="${1}-SNAPSHOT"
5-
echo "Snapshot version = $SNAPSHOT_VERSION"
3+
echo "Release version: $1"
64

7-
mvn versions:set -DnewVersion=$SNAPSHOT_VERSION
8-
9-
printenv
5+
mvn versions:set -DnewVersion=$1

prepare-snapshot.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
CURRENT_VERSION=$(git describe --tags --abbrev=0 | cut -d "v" -f 2)
4+
5+
echo "Current version: $CURRENT_VERSION"
6+
7+
MAJOR=$(echo $CURRENT_VERSION | cut -d "." -f 1)
8+
MINOR=$(echo $CURRENT_VERSION | cut -d "." -f 2)
9+
PATCH=$(echo $CURRENT_VERSION | cut -d "." -f 3)
10+
11+
PATCH=$((PATCH + 1))
12+
13+
SNAPSHOT_VERSION="$MAJOR.$MINOR.$PATCH-SNAPSHOT"
14+
echo "New snapshot version: $SNAPSHOT_VERSION"
15+
16+
mvn versions:set -DnewVersion=$SNAPSHOT_VERSION

0 commit comments

Comments
 (0)