From 68471bc30faa5e266b929bf45ef8c57f0adc2185 Mon Sep 17 00:00:00 2001 From: Lonami Date: Fri, 30 Oct 2020 09:55:57 +0100 Subject: [PATCH] Add workflow to automatically release artifacts Should help with #74. --- .github/workflows/desktop-release.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/desktop-release.yml diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml new file mode 100644 index 0000000..a5647d7 --- /dev/null +++ b/.github/workflows/desktop-release.yml @@ -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