Publish to maven

This commit is contained in:
Andrea Cavalli 2021-02-03 14:14:28 +01:00
parent 09ec134b51
commit 9ac9d27f07
2 changed files with 49 additions and 1 deletions

47
.github/workflows/maven-publish.yml vendored Normal file
View File

@ -0,0 +1,47 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Maven Package
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
build:
strategy:
matrix:
include:
- { os: ubuntu-20.04, arch: "linux/amd64" }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup variables
shell: bash
run: |
# ====== Variables
export REVISION=${{ github.run_number }}
echo "REVISION=$REVISION" >> $GITHUB_ENV
- name: Set up JDK 15
if: github.ref == 'refs/heads/master'
uses: actions/setup-java@v1
with:
java-version: 15
server-id: mchv-release-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy to Maven (Release)
if: github.ref == 'refs/heads/master'
shell: bash
run: |
echo "REVISION: $REVISION"
mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}

View File

@ -7,11 +7,12 @@
<groupId>it.cavallium</groupId> <groupId>it.cavallium</groupId>
<artifactId>dbengine</artifactId> <artifactId>dbengine</artifactId>
<version>2.0.1</version> <version>3.0.${revision}</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0-SNAPSHOT</revision>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>