File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Snapshot Deploy
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+
7+ jobs :
8+ deploy :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ contents : read
12+ packages : write
13+ steps :
14+ - uses : actions/checkout@v4
15+ - name : Setup Java 11
16+ uses : actions/setup-java@v3
17+ with :
18+ java-version : ' 11'
19+ distribution : ' temurin'
20+ cache : ' maven'
21+ - name : Generate settings.xml
22+ run : |
23+ cat > ~/.m2/settings.xml << EOF
24+ <settings>
25+ <servers>
26+ <server>
27+ <id>repsy-snapshots</id>
28+ <username>${{ secrets.REPSY_USERNAME }}</username>
29+ <password>${{ secrets.REPSY_PASSWORD }}</password>
30+ </server>
31+ </servers>
32+ </settings>
33+ EOF
34+ - name : Deploy only snapshot versions
35+ run : |
36+ VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
37+ echo "Detected version: $VERSION"
38+ if [[ $VERSION == *"SNAPSHOT"* ]]; then
39+ echo "Deploying snapshot version: $VERSION"
40+ mvn deploy -U -B
41+ else
42+ echo "Skipping deploy for release version: $VERSION"
43+ fi
44+ env :
45+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments