generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 51
81 lines (71 loc) · 1.97 KB
/
release-snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Deploy Snapshot
on:
workflow_dispatch:
inputs:
branch:
type: string
required: false
default: 'main'
description: 'The branch from which the snapshot should be built'
version:
type: string
required: false
description: 'The desired snapshot version'
workflow_call:
inputs:
branch:
type: string
required: false
default: 'main'
version:
type: string
required: false
defaults:
run:
shell: bash
permissions:
attestations: write
id-token: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare-version:
runs-on: ubuntu-latest
outputs:
version: ${{steps.snapshot-version.outputs.version}}
steps:
- uses: actions/checkout@v4
with:
ref: "${{inputs.branch}}"
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: 'maven'
- name: Retrieve and export project version
id: project-version
run: |
version=$(./mvnw help:evaluate -Puse-snapshots -Dexpression=project.version -q -DforceStdout)
echo "Project version: ${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Override project version if requested
id: snapshot-version
run: |
if [ -z "${{inputs.version}}" ];
then
echo "version=${{steps.project-version.outputs.version}}" >> $GITHUB_OUTPUT
else
echo "Version override requested: ${{inputs.version}}"
echo "version=${{inputs.version}}" >> $GITHUB_OUTPUT
fi
deploy-snapshot:
name: Deploy Snapshots
uses: quarkiverse/.github/.github/workflows/perform-release.yml@main
secrets: inherit
needs:
- prepare-version
with:
ref: main
version: ${{needs.prepare-version.outputs.version}}