Skip to content

Commit

Permalink
Fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsBodewig committed Oct 25, 2024
1 parent 88ca0d0 commit 5dc511d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/set-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ jobs:
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
- name: Evaluate old version
if: ${{ inputs.version == '' }}
run: |
echo "oldVersion=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_ENV"
- name: Set next snapshot
Expand All @@ -44,13 +43,11 @@ jobs:
if: ${{ inputs.version != '' }}
run: |
mvn -B versions:set -DgenerateBackupPoms=false -DnewVersion=${{ inputs.version }}
echo "commitMsg=Set version to $inputs.version" >> "$GITHUB_ENV"
echo "commitMsg=Set version to ${{ inputs.version }}" >> "$GITHUB_ENV"
- name: Evaluate new version
if: ${{ inputs.version == '' && endsWith(env.oldVersion, '-SNAPSHOT') }}
run: |
echo "newVersion=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_ENV"
- name: Update version in README
if: ${{ inputs.version == '' && endsWith(env.oldVersion, '-SNAPSHOT') }}
uses: richardrigutins/replace-in-files@v2
with:
files: 'README.md'
Expand All @@ -66,8 +63,8 @@ jobs:
- name: Set and push tag
if: ${{ inputs.version == '' && endsWith(env.oldVersion, '-SNAPSHOT') }}
run: |
git tag -a "v$inputs.version" -m "v$inputs.version" -f
git push origin v$inputs.version -f
git tag -a "v${{ env.newVersion }}" -m "v${{ env.newVersion }}" -f
git push origin v${{ env.newVersion }} -f
- name: Push commit
run: |
git push -f
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Hibernate Based Migrations are a ~~simple~~ method to do complex migrations of p
<plugin>
<groupId>dev.bodewig.hibernate-based-migration</groupId>
<artifactId>hibernate-based-migration-plugin</artifactId>
<version>1.0.0</version>
<version>1.0.2-SNAPSHOT</version>
</plugin>
```

Expand Down

0 comments on commit 5dc511d

Please sign in to comment.