Skip to content

Merge pull request #18 from aservo/feature/use-directories-resource-f… #62

Merge pull request #18 from aservo/feature/use-directories-resource-f…

Merge pull request #18 from aservo/feature/use-directories-resource-f… #62

Workflow file for this run

name: CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
package:
runs-on: ubuntu-20.04
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Code
uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Download Dependencies
run: ./mvnw dependency:go-offline -U -B
- name: Build with Maven
run: ./mvnw package -DskipUnitTests -B
unit-tests:
needs: package
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Code
uses: actions/checkout@v2
- name: Cache Maven package
uses: actions/cache@v2
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Run Unit Tests and analyze on SonarCloud
run: ./mvnw test sonar:sonar -B
integration-tests:
needs: package
runs-on: ubuntu-20.04
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Code
uses: actions/checkout@v2
- name: Cache Maven package
uses: actions/cache@v2
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Run Integration Tests
run: ./mvnw integration-test -DskipUnitTests -B
deploy:
needs: [unit-tests, integration-tests]
if: github.event_name == 'push' # to 'main'
runs-on: ubuntu-20.04
env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
SIGN_ASC_SALT: ${{ secrets.SIGN_ASC_SALT }}
SIGN_ASC_KEY: ${{ secrets.SIGN_ASC_KEY }}
SIGN_ASC_IV: ${{ secrets.SIGN_ASC_IV }}
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Code
uses: actions/checkout@v2
- name: Cache Maven package
uses: actions/cache@v2
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Decrypt Signing Key
run: openssl aes-256-cbc -S ${SIGN_ASC_SALT} -K ${SIGN_ASC_KEY} -iv ${SIGN_ASC_IV} -in .github/workflows/sign.asc.enc -out .github/workflows/sign.asc -d
- name: Import Signing Key
run: gpg --no-tty --batch --import .github/workflows/sign.asc
- name: Deploy to Maven Central
run: export GPG_TTY=$(tty) && ./mvnw -s .github/workflows/settings.xml -DskipTests deploy -B
apcc:
needs: package
runs-on: ubuntu-20.04
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Code
uses: actions/checkout@v2
- name: Cache Maven package
uses: actions/cache@v2
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Download APCC
run: ./mvnw dependency:get -DgroupId=de.aservo -DartifactId=atlassian-plugin-compatibility-check -Dversion=0.0.4
- name: Copy APCC to current Directory
run: ./mvnw dependency:copy -Dartifact=de.aservo:atlassian-plugin-compatibility-check:0.0.4 -DoutputDirectory=.
- name: Run APCC
run: java -jar atlassian-plugin-compatibility-check-0.0.4.jar "crowd.version"