-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Release a newly pushed release tag | ||
|
||
on: | ||
push: | ||
branches: | ||
- "!*" | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 13 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13 | ||
|
||
- 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 Version from Tag | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
- name: Set tag name as version | ||
run: mvn -B versions:set -DnewVersion=${{ steps.get_version.outputs.version-without-v }} --file pom.xml | ||
|
||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
|
||
- name: TGZ up the release | ||
run: mkdir release && mkdir release/mediatheken-dlna-bridge-${{ steps.get_version.outputs.version-without-v }} && cp -r target/*.jar target/libraries release/mediatheken-dlna-bridge-${{ steps.get_version.outputs.version-without-v }} && cd release && tar cvfz mediatheken-dlna-bridge-${{ steps.get_version.outputs.version-without-v }}.tar.gz mediatheken-dlna-bridge-${{ steps.get_version.outputs.version-without-v }} | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
Change logs are still a TODO in this project | ||
draft: false | ||
prerelease: true | ||
|
||
- 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: release/mediatheken-dlna-bridge-${{ steps.get_version.outputs.version-without-v }}.tar.gz | ||
asset_name: mediatheken-dlna-bridge-${{ steps.get_version.outputs.version-without-v }}.tar.gz | ||
asset_content_type: application/tar+gzip |