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

46 lines
1.2 KiB
YAML
Raw Normal View History

2023-06-23 18:48:38 +00:00
name: Make Release
on:
2023-06-23 19:02:35 +00:00
push:
2023-06-23 18:48:38 +00:00
tags: ["v*"]
jobs:
build:
runs-on: ubuntu-latest
permissions:
2023-06-23 19:02:35 +00:00
contents: write
2023-06-23 18:48:38 +00:00
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
2023-06-23 19:22:47 +00:00
- name: Extract Tag Version
id: get_version
run: echo "tag_version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
2023-06-23 18:48:38 +00:00
- 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 19:22:47 +00:00
cp $asset materials-extractor-${{steps.get_version.outputs.tag_version}}.jar
echo "asset_path=materials-extractor-${{steps.get_version.outputs.tag_version}}.jar" >> $GITHUB_OUTPUT
- name: Logs
run: |
echo "Version: ${{steps.get_version.outputs.tag_version}}"
echo "Asset: ${{steps.build.outputs.asset_path}}"
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}}
2023-06-23 19:02:35 +00:00
files: ${{steps.build.outputs.asset_path}}