Skip to content

Commit 54f12a1

Browse files
committed
fix for release job version update after release - test version
1 parent 0b8eb20 commit 54f12a1

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,46 @@ on:
33
release:
44
types: [created]
55
jobs:
6-
publish:
6+
# publish:
7+
# runs-on: ubuntu-latest
8+
# steps:
9+
# - uses: actions/checkout@v2
10+
# - name: Set up Java and Maven
11+
# uses: actions/setup-java@v1
12+
# with:
13+
# java-version: 1.8
14+
# - name: change version to release version
15+
# # Assume that RELEASE_VERSION will have form like: "v1.0.1". So we cut the "v"
16+
# run: mvn versions:set -DnewVersion="${RELEASE_VERSION:1}" versions:commit
17+
# env:
18+
# RELEASE_VERSION: ${{ github.event.release.tag_name }}
19+
# # see: https://github.com/keybase/keybase-issues/issues/2798
20+
# - name: Release Maven package
21+
# uses: samuelmeuli/action-maven-publish@v1
22+
# with:
23+
# maven_profiles: "release"
24+
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
25+
# gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
26+
# nexus_username: ${{ secrets.OSSRH_USERNAME }}
27+
# nexus_password: ${{ secrets.OSSRH_TOKEN }}
28+
29+
update-working-version:
730
runs-on: ubuntu-latest
831
steps:
932
- uses: actions/checkout@v2
10-
- name: Set up Maven Central Repository
33+
- name: Set up Java and Maven
1134
uses: actions/setup-java@v1
12-
with:
13-
java-version: 1.8
35+
with:
36+
java-version: 1.8
1437
- name: change version to release version
15-
# Assume that RELEASE_VERSION will have form like: "v1.0.1". So we cut the "v"
16-
run: mvn versions:set -DnewVersion="${RELEASE_VERSION:1}" versions:commit
17-
env:
18-
RELEASE_VERSION: ${{ github.event.release.tag_name }}
19-
# see: https://github.com/keybase/keybase-issues/issues/2798
20-
- name: Release Maven package
21-
uses: samuelmeuli/action-maven-publish@v1
22-
with:
23-
maven_profiles: "release"
24-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
25-
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
26-
nexus_username: ${{ secrets.OSSRH_USERNAME }}
27-
nexus_password: ${{ secrets.OSSRH_TOKEN }}
28-
- name: Set version to next snapshot version
29-
run: mvn -q build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
30-
- name: Commit files
3138
run: |
32-
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
33-
git fetch --all
34-
git checkout master
39+
mvn versions:set -DnewVersion="${RELEASE_VERSION:1}" versions:commit
40+
mvn -q build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
3541
git config --local user.email "action@github.com"
3642
git config --local user.name "GitHub Action"
3743
git commit -m "Set new SNAPSHOT version into pom files." -a
44+
env:
45+
RELEASE_VERSION: ${{ github.event.release.tag_name }}
3846
- name: Push changes
3947
uses: ad-m/github-push-action@master
4048
with:

0 commit comments

Comments
 (0)