-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·60 lines (52 loc) · 1.61 KB
/
Release.yaml
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
name: Release
on:
push:
branches:
- master
jobs:
Release:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "oracle"
java-version: "21"
check-latest: true
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Docker compose
run: docker-compose up -d
- name: Sleeping
run: sleep 45
- name: Publish package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn --batch-mode deploy org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-Dsonar.host.url="https://sonarcloud.io" \
-Dsonar.organization=memoria-io \
-Dsonar.projectKey=memoria-io_atom
- name: Get Maven project version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
MAVEN_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo $MAVEN_VERSION
echo "MAVEN_VERSION=$MAVEN_VERSION" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ env.MAVEN_VERSION }}',
sha: context.sha
})