MaterialsExtractor/.github/workflows/make-release.yml

50 lines
1.3 KiB
YAML
Raw Normal View History

2023-06-23 18:48:38 +00:00
name: Make Release
on:
2023-06-23 18:53:44 +00:00
create:
2023-06-23 18:48:38 +00:00
branches: ["main"]
tags: ["v*"]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Build with Maven
id: build
run: |
mvn -B package --file pom.xml
asset=$(find target/ -type f -name "*jar-with-dependencies.jar")
2023-06-23 18:53:44 +00:00
echo "name=asset_path::$asset" >> $GITHUB_STATE
2023-06-23 18:48:38 +00:00
- name: Extract Tag Version
id: get_version
2023-06-23 18:53:44 +00:00
run: echo "name=tag_version::${GITHUB_REF/refs\/tags\//}" >> $GITHUB_STATE
2023-06-23 18:48:38 +00:00
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: MaterialsExtractor ${{steps.get_version.outputs.tag_version}}
- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_name: materials-extractor-${{steps.get_version.outputs.tag_version}}.jar
asset_path: ${{steps.build.outputs.asset_path}}
asset_content_type: application/java-archive