Skip to content

Commit

Permalink
Merge pull request #22 from ebocher/fix_release
Browse files Browse the repository at this point in the history
Fix deploy action
  • Loading branch information
ebocher authored Sep 23, 2024
2 parents a2191a7 + 4a17a2d commit 848b64a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
46 changes: 43 additions & 3 deletions .github/workflows/CI release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,50 @@ jobs:
--batch-mode \
-P deploy \
release:prepare release:perform \
-Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN -DtagNameFormat=v@{project.version} \
${VERSION:+-DreleaseVersion VERSION}
-Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN ${VERSION:+"-DdevelopmentVersion="$VERSION"-SNAPSHOT"}
env:
MAVEN_USERNAME: ${{ secrets.MVN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MVN_CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSWORD }}
VERSION: $next-version

# Export the last git tag into env.
- name: Export env values
run: echo "GIT_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV

# Make the Github release from the last created tag. Write in its body the content of the changelog file.
- name: Make Github release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.GIT_TAG }}
name: ${{ env.GIT_TAG }}
bodyFile: "docs/CHANGELOG.md"
draft: false
prerelease: false

# Clear the changelog file and add its header
- name: Clear changelog
run: |
echo "## Changelog for v$( mvn help:evaluate -Dexpression=project.version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }' | cut -d- -f1)" > docs/CHANGELOG.md
git commit -a -m "Empty changelog."
git push origin master
# If the version change is a major or minor, create a branch from the previous tag for future revisions.
- name: Branch fork
run: |
GIT_TAG="${GIT_TAG:1}"
CUR_TAG="$( mvn help:evaluate -Dexpression=project.version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }' | cut -d- -f1)"
SPLIT0=(${GIT_TAG//./ })
SPLIT1=(${CUR_TAG//./ })
if [ "${SPLIT0[0]}" = "${SPLIT1[0]}" ] && [ "${SPLIT0[1]}" = "${SPLIT1[1]}" ]; then
echo "Revision change"
else
echo "Minor or Major change"
BRANCH="${SPLIT0[0]}.${SPLIT0[1]}.X"
git checkout -b "$BRANCH" "v${GIT_TAG}"
mvn versions:set -DnewVersion="${SPLIT0[0]}.${SPLIT0[1]}.$((${SPLIT0[2]}+1))-SNAPSHOT"
git commit -a -m "Set next version."
git push -u origin "$BRANCH"
fi
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Changelog for v1.0.0

- Update Javet to 3.1.8
- Add a new json serializer to load local files

0 comments on commit 848b64a

Please sign in to comment.