-
Notifications
You must be signed in to change notification settings - Fork 14
130 lines (109 loc) · 3.77 KB
/
main.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
name: CI
on:
push:
branches:
- master
- 'maintenance/*'
pull_request:
workflow_dispatch:
inputs:
publish:
description: Whether to publish the build result to Maven repositories
type: boolean
default: 'false'
required: false
publish_rcp:
description: Whether to publish the RCP to Github packages
type: boolean
default: 'false'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Gradle
run: |
echo "$(pwd)/rcp_resources/external_tools" >> "$GITHUB_PATH"
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: |
xvfb-run ./gradlew build_all_languages check \
-Pgpr.user=${{github.actor}} -Pgpr.token=${{ secrets.GITHUB_TOKEN }}
- name: Publish test report
uses: mikepenz/action-junit-report@v4
if: ${{ !cancelled() }}
with:
fail_on_failure: true
require_tests: true
report_paths: 'build/**/TEST*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run migrations
run: |
./gradlew migrate remigrate -x build_all_languages \
-Pgpr.user=${{github.actor}} -Pgpr.token=${{ secrets.GITHUB_TOKEN }}
- name: Check for dirty files
run: |
if [[ -n $(git status --porcelain | head --lines=1) ]]
then
echo "Dirty files detected after build/migration, run './gradlew migrate remigrate' and/or update .gitignore to fix:"
git status
echo "::group::git diff"
git diff
echo "::endgroup::"
exit 1
fi
#- name: Upload distribution
# uses: actions/upload-artifact@v4
# with:
# name: fasten-distribution-win-2023.2-${{ steps.time.outputs.time }}
# path: build/distributions/fasten-2023.2-SNAPSHOT-Win-2023.2-SNAPSHOT.zip
publish:
# Only publish on push (to maintenance or master) or on dispatch if requested
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish == 'true') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Publish
run: |
./gradlew publish \
-Pgpr.user=${{ github.actor }} \
-Pgpr.token=${{ secrets.GITHUB_TOKEN }} \
-Partifacts.itemis.cloud.user=${{ secrets.ARTIFACTS_ITEMIS_CLOUD_USER }} \
-Partifacts.itemis.cloud.pw=${{ secrets.ARTIFACTS_ITEMIS_CLOUD_PW }}
publish_rcps:
# Only publish on push (to maintenance or master) or on dispatch if requested
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.publish_rcp == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Publish FASTEN-Windows RCP to Github Packages
run: |
./gradlew publishFASTEN_WIN_RCPPublicationToGitHubPackagesRepository \
-Pgpr.user=${{ github.actor }} \
-Pgpr.token=${{ secrets.GITHUB_TOKEN }} \
- name: Publish FASTEN-Linux RCPs to Github Packages
run: |
./gradlew publishFASTEN_LINUX_RCPPublicationToGitHubPackagesRepository \
-Pgpr.user=${{ github.actor }} \
-Pgpr.token=${{ secrets.GITHUB_TOKEN }} \