From 249312734c665887cb6234db8c81b24d39bc1913 Mon Sep 17 00:00:00 2001 From: Mikhail Belyaev Date: Wed, 19 Aug 2020 02:16:18 +0300 Subject: [PATCH] Distribution management & deploying --- .github/bintray-settings.xml | 12 +++++++ .github/workflows/deployment.yml | 53 +++++++++++++++++++++++++++++++ .github/workflows/integration.yml | 17 ++++++++++ .github/workflows/maven.yml | 17 ++++++++++ pom.xml | 10 +++++- 5 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 .github/bintray-settings.xml create mode 100644 .github/workflows/deployment.yml create mode 100644 .github/workflows/integration.yml create mode 100644 .github/workflows/maven.yml diff --git a/.github/bintray-settings.xml b/.github/bintray-settings.xml new file mode 100644 index 0000000..85f42df --- /dev/null +++ b/.github/bintray-settings.xml @@ -0,0 +1,12 @@ + + + + + bintray-vorpal-research-kotlin-maven + ${env.BINTRAY_USERNAME} + ${env.BINTRAY_PASSWORD} + + + diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..3b4aea5 --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,53 @@ +name: Java CD + +on: + release: + types: published + +jobs: + publish: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Deploy to Bintray + id: deploy-to-bintray + run: | + mvn versions:set -DnewVersion=${{ github.event.release.tag_name }} + mvn deploy -s .github/bintray-settings.xml || echo "deploy failed" >&2 + env: + BINTRAY_USERNAME: ${{ secrets.bintray_username }} + BINTRAY_PASSWORD: ${{ secrets.bintray_password }} + + - name: Move sources jar file + run: mv target/*-sources.jar sources.jar + + - name: Move target jar file + run: mv target/*.jar target.jar + + - name: Attach source jar to release + id: upload-source-asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: sources.jar + asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-sources.jar + asset_content_type: application/zip + + - name: Attach target jar to release + id: upload-release-asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: target.jar + asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.jar + asset_content_type: application/zip \ No newline at end of file diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..a02111a --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,17 @@ +name: Java CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Maven + run: mvn -B package diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..b05aab9 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,17 @@ +name: Java CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Maven + run: mvn package --file pom.xml diff --git a/pom.xml b/pom.xml index b0c5f7a..1a2734d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ ru.spbstu Uni - 1.0-SNAPSHOT + 0.0.1-SNAPSHOT jar ru.spbstu Uni @@ -92,4 +92,12 @@ + + + bintray-vorpal-research-kotlin-maven + vorpal-research-kotlin-maven + https://api.bintray.com/maven/vorpal-research/kotlin-maven/${artifactId}/;publish=1 + + +