Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Version published on release. #12

Merged
merged 5 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ jobs:
java-version: 11
architecture: x64

- name: Set Main Version
run: echo "MAIN_VERSION=${{ github.event.release.name }}" >> src/main/java/org/spin/base/version.properties

- name: Set Release Date
run: echo "DATE_VERSION=$(date +'%Y-%m-%d')" >> src/main/java/org/spin/base/version.properties

- name: Set Implementation Version
run: echo "IMPLEMENTATION_VERSION=${{ github.event.release.tag_name }}" >> src/main/java/org/spin/base/version.properties

- name: Build with Gradle
uses: gradle/gradle-build-action@v3
with:
Expand All @@ -38,15 +47,6 @@ jobs:
GITHUB_DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
GITHUB_DEPLOY_REPOSITORY: ${{ secrets.DEPLOY_REPOSITORY }}

- name: Set Main Version
run: echo "MAIN_VERSION=${{ github.event.release.name }}" >> src/main/java/org/spin/base/version.properties

- name: Set Release Date
run: echo "DATE_VERSION=$(date +'%Y-%m-%d')" >> src/main/java/org/spin/base/version.properties

- name: Set Implementation Version
run: echo "IMPLEMENTATION_VERSION=${{ github.event.release.tag_name }}" >> src/main/java/org/spin/base/version.properties

- name: Upload descriptor file artifact
uses: actions/upload-artifact@v4
with:
Expand Down
27 changes: 14 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,17 @@ protobuf {
}

sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
srcDirs 'src/main/proto'
}
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
srcDirs 'src/main/proto'
}
resources {
srcDirs 'src/main/java'
include 'org/spin/base/version.properties'
}
}
}
}

// Copy proto descriptor another folder
Expand All @@ -111,16 +112,16 @@ allprojects {
}
}

task AdempiereTemplateServer(type: CreateStartScripts) {
task AdempiereReportEngineServer(type: CreateStartScripts) {
mainClass = javaMainClass
applicationName = 'adempiere-report-engine-service-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtimeClasspath
applicationName = 'adempiere-report-engine-service-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtimeClasspath
}

applicationDistribution.into('bin') {
from(AdempiereTemplateServer)
fileMode = 0755
from(AdempiereReportEngineServer)
fileMode = 0755
}

// Create release for project
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/org/spin/base/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
import java.text.SimpleDateFormat;
import java.util.Properties;

import org.compiere.util.CLogger;

/**
* @author Edwin Betancourt, [email protected], https://github.com/EdwinBetanc0urt
* Service for backend of Version
*/
public final class Version
{

private static CLogger log = CLogger.getCLogger(Version.class);

/** Main Version String */
// Conventions for naming second number is even for stable, and odd for unstable
// the releases will have a suffix (a) for alpha - (b) for beta - (t) for trunk - (s) for stable - and (LTS) for long term support
Expand Down Expand Up @@ -60,7 +64,8 @@ public final class Version
IMPLEMENTATION_VERSION = properties.getProperty("IMPLEMENTATION_VERSION");
}
} catch (IOException e) {
// file does not exist
// file does not exists
log.warning("File version.properties does no exists");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class ReportEngineServer {
/** Services/Methods allow request without Bearer token validation */
private List<String> ALLOW_REQUESTS_WITHOUT_TOKEN = Arrays.asList(
// proto package . proto service / proto method
"report_engine.ReportEngine/GetSystemInfo"
);

/** Revoke session */
Expand Down
Loading