Added testing if-statement.
This commit is contained in:
parent
cb78ff77cd
commit
e8f41b9953
|
@ -0,0 +1,61 @@
|
||||||
|
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
|
|
@ -33,3 +33,7 @@ jobs:
|
||||||
|
|
||||||
- name: Test with Maven
|
- name: Test with Maven
|
||||||
run: mvn -B verify --file pom.xml
|
run: mvn -B verify --file pom.xml
|
||||||
|
|
||||||
|
- name: Release If Tagged Main
|
||||||
|
if: github.ref_name === "main"
|
||||||
|
run: echo "Push to main!"
|
||||||
|
|
Loading…
Reference in New Issue