Skip to content

Commit

Permalink
Distribution management & deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
belyaev-mikhail committed Aug 18, 2020
1 parent c64803c commit 2493127
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/bintray-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>bintray-vorpal-research-kotlin-maven</id>
<username>${env.BINTRAY_USERNAME}</username>
<password>${env.BINTRAY_PASSWORD}</password>
</server>
</servers>
</settings>
53 changes: 53 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
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
17 changes: 17 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>ru.spbstu</groupId>
<artifactId>Uni</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>ru.spbstu Uni</name>
Expand Down Expand Up @@ -92,4 +92,12 @@
</repository>
</repositories>

<distributionManagement>
<repository>
<id>bintray-vorpal-research-kotlin-maven</id>
<name>vorpal-research-kotlin-maven</name>
<url>https://api.bintray.com/maven/vorpal-research/kotlin-maven/${artifactId}/;publish=1</url>
</repository>
</distributionManagement>

</project>

0 comments on commit 2493127

Please sign in to comment.