-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (116 loc) · 4.45 KB
/
maven-publish.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Maven Package
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Set version env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Set Maven package versions
run: mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=${RELEASE_VERSION}
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Create release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
file: "sleec-product/target/products/*.tar.gz;sleec-product/target/products/*.zip"
tags: true
draft: true
- name: Store release for sleec-core
uses: actions/upload-artifact@v4
with:
name: sleec-core
path: sleec-core
if-no-files-found: error
overwrite: true
retention-days: 1
- name: Store release for sleec-assertions
uses: actions/upload-artifact@v4
with:
name: sleec-assertions
path: sleec-assertions
if-no-files-found: error
overwrite: true
retention-days: 1
deploy-sleec-core:
runs-on: ubuntu-latest
needs: build
defaults:
run:
working-directory: SLEEC-TK/SLEEC-TK
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: sleec-core
- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.1
with:
ssh-private-key: ${{ secrets.SLEEC_CORE_SSH_PRIVATE_KEY }}
- name: Add SSH known hosts
run: echo "${ROBOSTAR_WEB_HOST} ${ROBOSTAR_WEB_SSH_FINGERPRINT_TYPE} ${ROBOSTAR_WEB_SSH_FINGERPRINT}" >> ~/.ssh/known_hosts
env:
ROBOSTAR_WEB_HOST: ${{ secrets.ROBOSTAR_WEB_HOST }}
ROBOSTAR_WEB_SSH_FINGERPRINT: ${{ secrets.ROBOSTAR_WEB_SSH_FINGERPRINT }}
ROBOSTAR_WEB_SSH_FINGERPRINT_TYPE: ${{ secrets.ROBOSTAR_WEB_SSH_FINGERPRINT_TYPE }}
- id: deploy
name: Deploy
uses: UoY-RoboStar/ga-eclipse-deploy@master
with:
remote-host: ${{ secrets.ROBOSTAR_WEB_HOST }}
remote-user: ${{ secrets.ROBOSTAR_WEB_USER }}
remote-root: ${{ secrets.ROBOSTAR_WEB_ROOT }}
remote-baseurl: 'https://robostar.cs.york.ac.uk'
remote-relative-path: 'robotool/sleec-core/'
maven-target: '${GITHUB_WORKSPACE}/sleec-core/circus.robocalc.sleec.repository/target/repository/'
- name: Create commit comment
uses: peter-evans/commit-comment@v1
with:
body: 'Successfully deployed at: https://robostar.cs.york.ac.uk/robotool/sleec-core/${{ steps.deploy.outputs.dest }}'
deploy-sleec-assertions:
runs-on: ubuntu-latest
needs: build
defaults:
run:
working-directory: SLEEC-TK/SLEEC-TK
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: sleec-assertions
- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.1
with:
ssh-private-key: ${{ secrets.SLEEC_ASSERTIONS_SSH_PRIVATE_KEY }}
- id: deploy
name: Deploy
uses: UoY-RoboStar/ga-eclipse-deploy@master
with:
remote-host: ${{ secrets.ROBOSTAR_WEB_HOST }}
remote-user: ${{ secrets.ROBOSTAR_WEB_USER }}
remote-root: ${{ secrets.ROBOSTAR_WEB_ROOT }}
remote-baseurl: 'https://robostar.cs.york.ac.uk'
remote-relative-path: 'robotool/sleec-assertions/'
maven-target: '${GITHUB_WORKSPACE}/sleec-assertions/circus.robocalc.sleec.assertions.csp.update/target/repository/'
- name: Create commit comment
uses: peter-evans/commit-comment@v1
with:
body: 'Successfully deployed at: https://robostar.cs.york.ac.uk/robotool/sleec-assertions/${{ steps.deploy.outputs.dest }}'