Skip to content

Commit

Permalink
github(actions): add release asset steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Hoefer committed Dec 18, 2020
1 parent 083763b commit 02dc993
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Build
name: Build and Release (Debian)

on:
push:
Expand All @@ -13,14 +10,36 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Test
run: ./gradlew test --stacktrace
- name: Build with Gradle
run: ./gradlew build
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Test
run: ./gradlew test --stacktrace
- name: Build with Gradle
run: ./gradlew build
- name: Create Debian Distribution
run: ./gradlew packageDeb
- 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 }}
draft: true
prerelease: false
- 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 }} # 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: ./build/compose/binaries/main/deb/ck3-workbench_0.0.1-1_amd64.deb
asset_name: ck3-workbench_0.0.1-1_amd64.deb
asset_content_type: application/zip

0 comments on commit 02dc993

Please sign in to comment.