perfin/.github/workflows/publish-release.yaml

62 lines
1.7 KiB
YAML

name: Publish Release
on:
push:
branches:
- "main"
tags:
- "v*"
jobs:
make_empty_release:
runs-on: ubuntu-latest
outputs:
version: ${{steps.get_version.outputs.tag_version}}
upload_url: ${{steps.create_release.outputs.upload_url}}
steps:
- name: Extract Tag Version
id: get_version
run: echo "::set-output name=tag_version::${GITHUB_REF/refs\/tags\//}"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: Perfin Release ${{steps.get_version.outputs.tag_version}}
build_linux_deb:
needs: make_empty_release
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: maven
- name: Install Maven 3.9.6
run: |
wget https://downloads.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
tar -xvf apache-maven-3.9.6-bin.tar.gz
sudo mv apache-maven-3.9.6 /usr/local/apache-maven
rm apache-maven-3.9.6-bin.tar.gz
sudo update-alternatives --install /usr/bin/mvn mvn /usr/local/apache-maven/bin/mvn 1
- name: Check versions
run: |
java -version
javac -version
mvn -version
- name: Build Package
id: build_package
run: |
./scripts/package-linux-deb.sh
asset=$(find -type f name "*.deb")
echo "Found asset: $asset"
echo "::set-output name=asset_file::$asset"
- name: Add to Release
uses: actions/upload-release-asset@v1