kotlin-atlassian-client - default #328
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: kotlin-atlassian-client - default | |
on: | |
push: | |
branches: | |
- '**' | |
release: | |
types: [ created ] | |
schedule: | |
- cron: '0 4 * * 2' # At 02:00 on Tuesday | |
env: | |
MAIN_BRANCH: 'dev' | |
MAIN_BRANCH_FULL: 'refs/heads/dev' | |
MAVEN_OPTS: > | |
-Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Daether.connector.http.connectionMaxTtl=25 | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
outputs: | |
version: ${{ steps.extract-version.outputs.version }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Extract and Set Release Version | |
if: ${{ github.event_name == 'release' }} | |
id: extract-version | |
run: | | |
VERSION=$(git describe --tags | cut -d v -f2) | |
echo "Detected version = $VERSION" | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
- name: Build libraries | |
run: mvn package -T 2 -Pci "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
# JIRA | |
# ------------------------------------------------------- | |
kotlin-jira-client-test-ktor: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Set Release Version | |
if: ${{ github.event_name == 'release' }} | |
id: extract-version | |
run: | | |
VERSION="${{ needs.build.outputs.version }}" | |
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
- name: Startup Jira and Insight | |
# Loop is needed to prevent Jira from suspension | |
run: (while true; do sleep 10000; done) | mvn jira:debug -Pitest-jira,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor,-jira-itest-applink,-jira-itest-ktor,-jira-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" & | |
- name: Wait for Jira and Insight | |
run: ./scripts/wait-for-jira.sh | |
- name: Integration tests using ktor | |
run: mvn -B verify -Pjira-itest-ktor,jira-ci-ktor,-jira-itest-applink,-jira-itest-sdk,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
kotlin-jira-client-test-applink: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Set Release Version | |
if: ${{ github.event_name == 'release' }} | |
id: extract-version | |
run: | | |
VERSION="${{ needs.build.outputs.version }}" | |
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
- name: Startup Jira and Insight | |
# Loop is needed to prevent Jira from suspension | |
run: (while true; do sleep 10000; done) | mvn jira:debug -Pitest-jira,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor,-jira-itest-applink,-jira-itest-ktor,-jira-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" & | |
- name: Wait for Jira and Insight | |
run: ./scripts/wait-for-jira.sh | |
- name: Add hosts to /etc/hosts | |
run: sudo echo "127.0.0.1 confluence" | sudo tee -a /etc/hosts | |
- name: Integration tests using applinks | |
run: mvn -B verify -Pjira-itest-applink,jira-ci-applink,-jira-itest-ktor,-jira-itest-sdk,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://confluence:1990" | |
kotlin-jira-client-test-sdk: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Set Release Version | |
if: ${{ github.event_name == 'release' }} | |
id: extract-version | |
run: | | |
VERSION="${{ needs.build.outputs.version }}" | |
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
- name: Integration tests using sdk | |
run: mvn clean -B verify -Pjira-itest-sdk,jira-ci-sdk,-jira-itest-applink,-jira-itest-ktor,-insight-itest-sdk,-insight-itest-applink,-insight-itest-ktor "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" | |
# INSIGHT | |
# ------------------------------------------------------- | |
kotlin-insight-client-test-ktor: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Set Release Version | |
if: ${{ github.event_name == 'release' }} | |
id: extract-version | |
run: | | |
VERSION="${{ needs.build.outputs.version }}" | |
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
- name: Startup Jira and Insight | |
# Loop is needed to prevent Jira from suspension | |
run: (while true; do sleep 10000; done) | mvn jira:debug -Pitest-jira,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor,-jira-itest-applink,-jira-itest-ktor,-jira-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" & | |
- name: Wait for Jira and Insight | |
run: ./scripts/wait-for-jira.sh | |
- name: Integration tests using ktor | |
run: mvn -B verify -Pinsight-itest-ktor,insight-ci-ktor,-jira-itest-applink,-jira-itest-sdk,-jira-itest-ktor,-insight-itest-applink,-insight-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
kotlin-insight-client-test-sdk: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Set Release Version | |
if: ${{ github.event_name == 'release' }} | |
id: extract-version | |
run: | | |
VERSION="${{ needs.build.outputs.version }}" | |
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
- name: Integration tests using sdk | |
run: mvn -B verify -Pinsight-itest-sdk,insight-ci-sdk,-insight-itest-ktor,-insight-ci-ktor,-jira-itest-applink,-jira-itest-sdk,-jira-itest-ktor,-insight-itest-applink "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" | |
kotlin-insight-client-test-applink: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Set Release Version | |
if: ${{ github.event_name == 'release' }} | |
id: extract-version | |
run: | | |
VERSION="${{ needs.build.outputs.version }}" | |
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
- name: Startup Jira and Insight | |
# Loop is needed to prevent Jira from suspension | |
run: (while true; do sleep 10000; done) | mvn jira:debug -Pitest-jira,-insight-itest-sdk,-insight-itest-ktor,-jira-itest-applink,-insight-itest-applink,-jira-itest-ktor,-jira-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" & | |
- name: Wait for Jira and Insight | |
run: ./scripts/wait-for-jira.sh | |
- name: Add hosts to /etc/hosts | |
run: sudo echo "127.0.0.1 confluence" | sudo tee -a /etc/hosts | |
- name: Integration tests using applinks | |
run: mvn -B verify -Pinsight-itest-applink,insight-ci-applink,-insight-itest-ktor,-insight-itest-sdk,-jira-itest-ktor,-jira-itest-sdk,-jira-itest-applink "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://confluence:1990" | |
deploy-to-central: | |
runs-on: ubuntu-20.04 | |
needs: [ build, kotlin-jira-client-test-sdk, kotlin-jira-client-test-ktor, kotlin-jira-client-test-applink, kotlin-insight-client-test-ktor, kotlin-insight-client-test-applink, kotlin-insight-client-test-sdk ] | |
if: ${{ github.event_name == 'release' }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Extract, set and commit Release Version | |
id: extract-version | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "GitHub Actions" | |
VERSION="${{ needs.build.outputs.version }}" | |
mvn -B versions:set "-DnewVersion=$VERSION" versions:commit "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
git commit -am "[skip ci] set release version $VERSION" | |
git push origin HEAD:$MAIN_BRANCH | |
TAG_NAME="v$VERSION" | |
git tag -f $TAG_NAME | |
git push origin -f --tags | |
- name: Install GPG Secret Key | |
id: install-secret-key | |
run: cat <(echo -e "${{ secrets.SIGNING_KEY }}") | gpg --batch --import | |
- name: Deploy to Maven Central | |
run: mvn -B deploy -Pci,-ci-sdk,-ci-jira-applink,-ci-ktor -DskipTests "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
prepare-next-snapshot: | |
runs-on: ubuntu-20.04 | |
needs: [ build, deploy-to-central ] | |
if: ${{ github.event_name == 'release' }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
- name: Download Maven Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Setup JDK 1.8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Prepare next Snapshot Version | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "GitHub Actions" | |
git fetch origin $MAIN_BRANCH | |
git reset --hard origin/$MAIN_BRANCH | |
VERSION="${{ needs.build.outputs.version }}" | |
MAJOR_VERSION=$(echo "$VERSION" | cut -d . -f1) | |
MINOR_VERSION=$(echo "$VERSION" | cut -d . -f2) | |
INCREMENT_VERSION=$(echo "$VERSION" | cut -d . -f3) | |
NEXT_INCREMENT_VERSION=$((INCREMENT_VERSION + 1)) | |
NEXT_SNAPSHOT_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$NEXT_INCREMENT_VERSION-SNAPSHOT" | |
mvn -B versions:set "-DnewVersion=$NEXT_SNAPSHOT_VERSION" versions:commit "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" | |
git commit -am "[skip ci] set development version $NEXT_SNAPSHOT_VERSION" | |
git push origin HEAD:$MAIN_BRANCH | |
notify-slack: | |
needs: prepare-next-snapshot | |
if: always() | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Notify Slack | |
if: ${{ github.ref == env.MAIN_BRANCH_FULL || github.event_name == 'release' }} | |
uses: iRoachie/[email protected] | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
GITHUB_TOKEN: ${{ secrets.GH_API_TOKEN }} |