Repository navigation
85 lines (73 loc) · 2.11 KB
/
Copy pathmain-build-and-deploy.yml
File metadata and controls
85 lines (73 loc) · 2.11 KB
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
82
83
84
85
name: Deploy to Artifactory on pre-released
env:
JAVA_VERSION: '21'
MAVEN_VERSION: '3.6.3'
DEPLOY_REPOSITORY_URL: 'https://common.repositories.cloud.sap/artifactory/cap-sdm-java'
POM_FILE: '.flattened-pom.xml'
on:
release:
types: [ "prereleased" ]
jobs:
update-version:
environment: dev
runs-on: ubuntu-latest
#needs: blackduck
steps:
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ secrets.GH_TOKEN }}
- name: Update version
uses: ./.github/actions/newrelease
with:
java-version: ${{ env.JAVA_VERSION }}
maven-version: ${{ env.MAVEN_VERSION }}
- name: Upload Changed Artifacts
uses: actions/upload-artifact@v6
with:
name: root-new-version
include-hidden-files: true
path: .
retention-days: 1
build:
environment: dev
runs-on: ubuntu-latest
needs: update-version
steps:
- name: Download artifact
uses: actions/download-artifact@v7
with:
name: root-new-version
- name: Build
uses: ./.github/actions/build
with:
java-version: ${{ env.JAVA_VERSION }}
maven-version: ${{ env.MAVEN_VERSION }}
- name: Upload Changed Artifacts
uses: actions/upload-artifact@v6
with:
name: root-build
include-hidden-files: true
path: .
retention-days: 1
deploy:
name: Deploy to Artifactory
environment: dev
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v7
with:
name: root-build
- name: Deploy with Maven
uses: ./.github/actions/deploy
with:
user: ${{ secrets.CAP_DEPLOYMENT_USER }}
password: ${{ secrets.CAP_DEPLOYMENT_PASS }}
server-id: artifactory
repository-url: ${{ env.DEPLOY_REPOSITORY_URL }}
pom-file: ${{ env.POM_FILE }}
maven-version: ${{ env.MAVEN_VERSION }}
- name: Echo Status
run: echo "The job status is ${{ job.status }}"