-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (57 loc) · 1.87 KB
/
release.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
name: tag release
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin' #Eclipse Temurin
- uses: oneteme/automation-scripts/.github/actions/sonar-java-scan@main
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: oneteme/automation-scripts/.github/actions/mvn-project-version@main
id: prj_ver
outputs:
version: ${{ steps.prj_ver.outputs.version }}
deploy:
needs: build
if: "!endsWith(needs.build.outputs.version, '-SNAPSHOT')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin' #Eclipse Temurin
- run: mvn --batch-mode --no-transfer-progress -Ppg clean package
- run: |
version=${{ needs.build.outputs.version }}
echo "minVer=${version%*.*}" >> $GITHUB_OUTPUT #major.minor
id: extract
- uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
#- uses: docker/setup-qemu-action@v3.2.0 #multiple architectures ARM, x86_64, etc.
#- uses: docker/setup-buildx-action@v3.8.0
- uses: docker/build-push-action@v6.10.0
with:
context: .
tags: "oneteme/${{ github.event.repository.name }}:${{ steps.extract.outputs.minVer }}"
push: true
release:
needs:
- build
- deploy
runs-on: ubuntu-latest
steps:
- uses: oneteme/automation-scripts/.github/actions/create-release-notes@main
with:
version: ${{ needs.build.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}