Push release to AKSW maven and create GitHub release #9
Workflow file for this run
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: Push release to AKSW maven and create GitHub release | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and Release | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
server-id: 'maven.aksw.internal' # Value of the distributionManagement/repository/id field of the pom.xml | |
server-username: 'MAVEN_USERNAME' # env variable for username in deploy | |
server-password: 'MAVEN_TOKEN' # env variable for token in deploy | |
- name: Preserve Settings | |
run: cp ~/.m2/settings.xml ~/.m2_settings.xml | |
- name: Cache Maven packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Preserve Settings 2 | |
run: mv ~/.m2_settings.xml ~/.m2/settings.xml | |
- name: Publish to AKSW Maven | |
run: mvn -B deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USER }} | |
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} | |
- name: Prepare shaded JAR | |
run: mvn -B package shade:shade -Dmaven.test.skip=true | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) | |
- name: Copy JAR | |
run: cp -p limes-core/target/limes-core-${{ steps.get_version.outputs.VERSION }}.jar limes.jar | |
- name: Release on GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: LIMES ${{ steps.get_version.outputs.VERSION }} | |
body: Released LIMES ${{ steps.get_version.outputs.VERSION }} | |
#bodyPath: @todo automatically extract changes from changelog | |
files: | | |
LICENSE | |
limes.jar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
file: .github/Dockerfile | |
context: . | |
push: true | |
tags: dicegroup/limes:latest,dicegroup/limes:${{ steps.get_version.outputs.VERSION }} |