Skip to content

Commit 22a07ff

Browse files
committed
add snapshot releases to release pipeline
1 parent 0015b57 commit 22a07ff

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/actions/version/action.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ description: |
1313
uses: .github/actions/version
1414
with:
1515
new_version: 1.20.0
16-
```
16+
```
1717
1818
inputs:
1919
new_version:
2020
description: New package version, expressed as SemVer (1.x.y)
2121
required: true
22+
snapshot:
23+
description: New version is a SNAPSHOT release
24+
required: true
25+
default: 'false'
2226

2327
outputs:
2428
old_version:
@@ -36,6 +40,15 @@ runs:
3640
3741
- id: replace_version
3842
name: Replace current version
39-
shell: |
43+
shell: bash
44+
run: |
45+
mvn versions:set -DnewVersion=${{ inputs.new_version }} -DprocessAllModules=true -DallowSnapshots=true
46+
47+
- id: asset_veersion
48+
name: Replace version for assets
49+
if: ${{ inputs.snapshot == 'true' }}
50+
env:
51+
current_version: ${{ steps.current_version.outputs.current_version }}
52+
shell: bash
4053
run: |
41-
mvn versions:set -DnewVersion=${{ inputs.new_version }} -DprocessAllModules=true -DallowSnapshots=true
54+
grep "${{ env.current_version }}" -r . --include build.gradle --include build.gradle.kts --include mkdocs.yml --include README.md -l | xargs sed -i 's#${{ env.current_version }}#${{ inputs.new_version }}#'

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
uses: ./.github/actions/version
4242
with:
4343
new_version: ${{ inputs.version }}
44+
snapshot: ${{ inputs.snapshot}}
4445
- id: upload_source
4546
name: Upload artifacts
4647
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1

0 commit comments

Comments
 (0)