diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 951af3d..775c0b5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -3,15 +3,28 @@ name: peppol-specifications Master Build on: [push] jobs: - build: + master-branch-build: + if: github.ref == 'refs/heads/master' # run this job only for the master branch + runs-on: ubuntu-latest - runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Maven + run: mvn -B --no-transfer-progress package - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build with Maven - run: mvn -B --no-transfer-progress package + milestone-6-branch-build: + if: github.ref == 'refs/heads/milestone-6' # run this job only for the milestone-6 branch + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Build with Maven + run: mvn -B --no-transfer-progress package \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2c577fd..d950c65 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,20 +3,39 @@ name: peppol-specifications Snapshot publish on: [push] jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Maven Central Repository - uses: actions/setup-java@v1 - with: - java-version: 1.8 - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - - name: Publish package - run: mvn --batch-mode deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + master-branch-publish: + if: github.ref == 'refs/heads/master' # run this job only for the master branch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Maven Central Repository + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish package + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + + milestone-6-branch-build: + if: github.ref == 'refs/heads/milestone-6' # run this job only for the milestone-6 branch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Maven Central Repository + uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish package + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}