Skip to content

Commit

Permalink
Use distribution management
Browse files Browse the repository at this point in the history
  • Loading branch information
caoli5288 committed Mar 9, 2021
1 parent ad12ff8 commit 49a2994
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 18 deletions.
49 changes: 33 additions & 16 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
name: Java CI

on: [push]
on:
push:
tags:
- 'v*'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
version: 1.8
server-id: snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build with Maven
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- uses: actions/checkout@master
- uses: actions/setup-java@v1
with:
version: 1.8
server-id: releases
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${GITHUB_REF##*/}
release_name: ${GITHUB_REF##*/}
draft: false
prerelease: false
- id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: target/SimpleORM.jar
asset_name: SimpleORM.jar
asset_content_type: application/java-archive
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
<artifactId>simpleorm</artifactId>
<version>1.4-SNAPSHOT</version>

<name>SimpleORM</name>

<repositories>
<repository>
<id>i7mc_repository</id>
<url>http://repository.i7mc.com:8008/</url>
<id>snapshots</id>
<url>http://repo.i7mc.com/snapshots</url>
</repository>
<repository>
<id>releases</id>
<url>http://repo.i7mc.com/releases</url>
</repository>
</repositories>

Expand Down Expand Up @@ -64,6 +70,7 @@
</dependencies>

<build>
<finalName>${name}</finalName>
<defaultGoal>clean install</defaultGoal>
<plugins>
<plugin>
Expand Down

0 comments on commit 49a2994

Please sign in to comment.