Skip to content

Commit

Permalink
maven.yml optimized
Browse files Browse the repository at this point in the history
# TODO
Check if there is any buggy functions
Implement test units
Enhance metadata reader stylesheet
Fix buggy Embed autocomplete/detection
  • Loading branch information
zxzinn committed Sep 3, 2024
1 parent 28e43d3 commit 7eb370a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
27 changes: 2 additions & 25 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,11 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Set version (Linux)
if: runner.os == 'Linux'
- name: Get version from pom.xml
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
VERSION=$(git describe --tags --always --dirty | sed 's/^v//; s/-/./')
CLEAN_VERSION=$(echo $VERSION | sed 's/[^0-9.]//g')
if [[ ! $CLEAN_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
CLEAN_VERSION="0.1.7-SNAPSHOT"
fi
echo "PROJECT_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
echo "Set version to $CLEAN_VERSION"
echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)" >> $GITHUB_ENV
shell: bash

- name: Set version (Windows)
if: runner.os == 'Windows'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
$VERSION = (git describe --tags --always --dirty) -replace '^v','' -replace '-','.'
$CLEAN_VERSION = $VERSION -replace '[^0-9.]',''
if ($CLEAN_VERSION -notmatch '^\d+\.\d+\.\d+$') {
$CLEAN_VERSION = "0.1.7-SNAPSHOT"
}
echo "PROJECT_VERSION=$CLEAN_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "Set version to $CLEAN_VERSION"
shell: pwsh

- name: Build with Maven
run: mvn clean install -B -V

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<name>NovelAI-Studio-FX</name>

<properties>
<revision>0.1.7-SNAPSHOT</revision>
<revision>0.1.8-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
Expand Down

0 comments on commit 7eb370a

Please sign in to comment.