-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (71 loc) · 3 KB
/
ci.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
name: CI
on:
push:
branches: [main]
release:
types: [created]
schedule:
- cron: '30 2 * * *' # run nightly at 2:30 am
workflow_call:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml', '**/MANIFEST.MF') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Build and Verify
run: >
./mvnw -B -U clean verify
'-Dstyle.color=always'
'-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
'-Dorg.slf4j.simpleLogger.log.org.eclipse.tycho.core.resolver.DefaultTychoResolver=warn'
'-Dorg.slf4j.simpleLogger.log.org.eclipse.tycho.osgi.configuration.MavenContextConfigurator=warn'
'-Dorg.slf4j.simpleLogger.log.org.eclipse.sisu.equinox.launching.internal.DefaultEquinoxLauncher=warn'
'-Dorg.slf4j.simpleLogger.log.org.eclipse.xtext.maven.XtextGenerateMojo=warn'
'-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog'
env:
MAVEN_OPTS: -Djansi.force=true
- name: Store Change Artifact
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: change
path: releng/tools.vitruv.change.updatesite/target/repository
retention-days: 1
- name: Publish Nightly Update Site
if: github.event_name != 'release' && github.ref == 'refs/heads/main' && github.repository_owner == 'vitruv-tools' && matrix.os == 'ubuntu-latest'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.UPDATE_SITE_DEPLOY_KEY }}
external_repository: vitruv-tools/updatesite
destination_dir: nightly/change
publish_dir: releng/tools.vitruv.change.updatesite/target/repository
publish_branch: main
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
- name: Publish Release Update Site
if: github.event_name == 'release' && github.repository_owner == 'vitruv-tools' && matrix.os == 'ubuntu-latest'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.UPDATE_SITE_DEPLOY_KEY }}
external_repository: vitruv-tools/updatesite
destination_dir: release/change/${{ github.event.release.tag_name }}
publish_dir: releng/tools.vitruv.change.updatesite/target/repository
publish_branch: main
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'