Skip to content

Commit

Permalink
Added release pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
McJeffr committed Aug 19, 2020
1 parent 19f0fcd commit 01ade8d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Get artifact version
id: version
run: echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"

- name: Build artifact
run: mvn -B clean package --file pom.xml

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Release ${{github.ref }}

- name: Upload release asset
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 }}
asset_path: ./target/world-downloader-${{ steps.version.outputs.version }}.jar
asset_name: world-downloader-${{ steps.version.outputs.version }}.jar
asset_content_type: application/java-archive
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.fairsquare</groupId>
<artifactId>world-downloader</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>World Downloader</name>
Expand Down

0 comments on commit 01ade8d

Please sign in to comment.