Release Publisher #11
Workflow file for this run
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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Release Publisher | |
on: | |
create: | |
tags: | |
- 'v*' # run only on all tags | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 12 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 12 | |
- name: Build with Maven | |
# without -DskipTests, we also run tests, which should prevent | |
# the package from being packaged if tests fail | |
run: mvn -B package --file pom.xml -P dist | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Determine Changelog | |
id: changelog_determiner | |
run: echo "##[set-output name=changelog;]$(./bin/extract-changelog.sh CHANGELOG.md ${{ steps.get_version.outputs.VERSION }})" | |
- name: Create Release | |
id: create_release | |
if: success() | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: ${{ steps.changelog_determiner.outputs.changelog }} | |
draft: false | |
prerelease: false | |
- name: Upload Release | |
id: upload_release | |
if: success() | |
#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: ./my-artifact.zip | |
# asset_name: my-artifact.zip | |
# asset_content_type: application/zip | |
uses: csexton/release-asset-action@v2 | |
with: | |
pattern: "target/DataShot*.jar" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
release-url: ${{ steps.create_release.outputs.upload_url }} |