Add workflow to automatically release artifacts

Should help with #74.
This commit is contained in:
Lonami 2020-10-30 09:55:57 +01:00 committed by GitHub
parent 21358abff9
commit 68471bc30f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

45
.github/workflows/desktop-release.yml vendored Normal file
View file

@ -0,0 +1,45 @@
name: Automatic Desktop Release
on:
push:
tags:
- 'v*'
jobs:
build:
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: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew desktop:dist
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: 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: ./desktop/build/libs/*.jar
asset_name: Klooni-${{ github.ref }}.jar
asset_content_type: application/java-archive