diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1ece36f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: + push: + branches: [master] + create: + tags: + pull_request: + schedule: + - cron: '30 2 * * *' # run nightly at 2:30 am + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml', '**/MANIFEST.MF') }} + restore-keys: ${{ runner.os }}-m2 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Build and Verify + uses: GabrielBB/xvfb-action@v1 + with: + run: > + ./mvnw -B 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 + env: + MAVEN_OPTS: -Djansi.force=true + - name: Publish Nightly Update Site + if: github.ref == 'refs/heads/master' && github.repository_owner == 'kit-sdq' + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.UPDATE_SITE_DEPLOY_KEY }} + external_repository: kit-sdq/updatesite + destination_dir: nightly/metamodels/demo + publish_dir: releng/edu.kit.ipd.sdq.metamodels.demo.updatesite/target/repository + publish_branch: master + - name: Determine Release Version + if: startsWith(github.ref, 'refs/tags/releases/') && github.repository_owner == 'kit-sdq' + id: releaseVersion + uses: little-core-labs/get-git-tag@v3.0.2 + with: + tagRegex: "releases/(.*)" + - name: Publish Release Update Site + if: startsWith(github.ref, 'refs/tags/releases/') && github.repository_owner == 'kit-sdq' + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.UPDATE_SITE_DEPLOY_KEY }} + external_repository: kit-sdq/updatesite + destination_dir: release/metamodels/demo/${{ steps.releaseVersion.outputs.tag }} + publish_dir: releng/edu.kit.ipd.sdq.metamodels.demo.updatesite/target/repository + publish_branch: master + +