Skip to content

Commit

Permalink
automatic creation of release assets
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-kuba committed Sep 2, 2020
1 parent bb85379 commit e6c2c5a
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Maven build
name: "Maven test build"
on: [ push, pull_request ]
jobs:
test:
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# from https://github.com/actions/upload-release-asset
name: "Make a release"
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
publish:
name: "Build and upload release assets"
runs-on: ubuntu-latest
steps:
- name: "Check out code"
uses: actions/checkout@v2
- name: "Set up JDK"
uses: actions/setup-java@v1
with:
java-version: 8
- name: "Cache"
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Compile and package"
run: mvn -B clean install
- 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: false
prerelease: false
- name: "Upload asset perun-rpc.war"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: perun-rpc/target/perun-rpc.war
asset_name: perun-rpc.war
asset_content_type: application/x-webarchive
- name: "Upload asset perun-engine.jar"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: perun-engine/target/perun-engine.jar
asset_name: perun-engine.jar
asset_content_type: application/java-archive
- name: "Upload asset perun-ldapc.jar"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: perun-ldapc/target/perun-ldapc.jar
asset_name: perun-ldapc.jar
asset_content_type: application/java-archive
- name: "Upload asset perun-web-gui.war"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: perun-web-gui/target/perun-web-gui.war
asset_name: perun-web-gui.war
asset_content_type: application/x-webarchive
- name: "Upload asset perun-cli-java.jar"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: perun-cli-java/target/perun-cli-java.jar
asset_name: perun-cli-java.jar
asset_content_type: application/java-archive

0 comments on commit e6c2c5a

Please sign in to comment.