CI #474
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- 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' |