diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 000000000..9645b5676 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,53 @@ +# Build and potentially deploy code on PRs merging into the develop or master branch +name: CI/CD + +on: + pull_request: + branches: [ master, develop ] + types: [assigned, opened, synchronize, reopened, closed ] # Run when there are updates to the code in the PR or when the PR is closed and merged + +jobs: + build: # Only build when not merging + if: ${{ !github.event.pull_request.merged }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Build with Ant + uses: GabrielBB/xvfb-action@v1 + with: + working-directory: ./build/ant + run: | + ant -noinput -buildfile build.xml + + deploy: + # Build and deploy when merging + # Needs to be in a full job because file workspace isn't shared between jobs, so cannot easily refactor + if: ${{ github.event.pull_request.merged }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Build with Ant + uses: GabrielBB/xvfb-action@v1 + with: + working-directory: ./build/ant + run: | + ant -noinput -buildfile build.xml + - name: Deploy files + shell: bash + run: | + /usr/bin/chmod +x ./build/publish-artifacts.sh + /usr/bin/bash ./build/publish-artifacts.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml deleted file mode 100644 index 28860cb34..000000000 --- a/.github/workflows/commit.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This workflow will build a Java project with Ant -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant - -name: PR Build - -on: - pull_request: - branches: [ master, develop ] - types: [assigned, opened, synchronize, reopened] - - -jobs: - build: - if: github.event.pull_request.merged == false - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build with Ant - uses: GabrielBB/xvfb-action@v1 - with: - working-directory: ./build/ant - run: ant -noinput -buildfile build.xml diff --git a/.github/workflows/dev_merge.yml b/.github/workflows/dev_merge.yml deleted file mode 100644 index 87eb3ddda..000000000 --- a/.github/workflows/dev_merge.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow will build a Java project with Ant -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant - -name: Dev Build - -on: - pull_request: - branches: [ develop ] - types: [ closed ] - -jobs: - deploy: - if: ${{ github.event.pull_request.merged }} - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build with Ant - uses: GabrielBB/xvfb-action@v1 - with: - working-directory: ./build/ant - run: | - ant -noinput -buildfile build.xml - - name: Deploy files - shell: bash - run: | - /usr/bin/chmod +x ./build/publish-artifacts.sh - /usr/bin/bash ./build/publish-artifacts.sh - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/master_merge.yml b/.github/workflows/master_merge.yml deleted file mode 100644 index ee039edbc..000000000 --- a/.github/workflows/master_merge.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow will build a Java project with Ant -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant - -name: Master Build - -on: - pull_request: - branches: [ master ] - types: [ closed ] - -jobs: - deploy: - if: ${{ github.event.pull_request.merged }} - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Build with Ant - uses: GabrielBB/xvfb-action@v1 - with: - working-directory: ./build/ant - run: | - ant -noinput -buildfile build.xml - - name: Deploy files - shell: bash - run: | - /usr/bin/chmod +x ./build/publish-artifacts.sh - /usr/bin/bash ./build/publish-artifacts.sh - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build/maven/build.xml b/build/maven/build.xml index b1602d657..3a7947f44 100644 --- a/build/maven/build.xml +++ b/build/maven/build.xml @@ -21,7 +21,8 @@ - + +