Skip to content

Commit

Permalink
Use git tag in delivry assets
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilvrousos committed Mar 25, 2024
1 parent 04fcf3f commit 089e5f0
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 40 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ jobs:
with:
run: |
mvn -B package --file pom.xml
./gradlew build vscodeExtension
./gradlew -Pversion=${{ github.ref_name }} updateVersion build vscodeExtension
- name: Rename output file
run: |
mv ${{ github.workspace }}/org.eclipse.xsmp.repository/target/org.eclipse.xsmp.repository.zip ${{ github.workspace }}/org.eclipse.xsmp.repository-${{ github.ref_name }}.zip
mv ${{ github.workspace }}/org.eclipse.xsmp.tool.smp/build/libs/org.eclipse.xsmp.tool.smp-cli.jar ${{ github.workspace }}/org.eclipse.xsmp.tool.smp.cli-${{ github.ref_name }}.jar
mv ${{ github.workspace }}/org.eclipse.xsmp.tool.python/build/libs/org.eclipse.xsmp.tool.python-cli.jar ${{ github.workspace }}/org.eclipse.xsmp.tool.python.cli-${{ github.ref_name }}.jar
mv ${{ github.workspace }}/org.eclipse.xsmp.profile.xsmp_sdk/build/libs/org.eclipse.xsmp.profile.xsmp_sdk-cli.jar ${{ github.workspace }}/org.eclipse.xsmp.profile.xsmp_sdk.cli-${{ github.ref_name }}.jar
mv ${{ github.workspace }}/org.eclipse.xsmp.profile.esa_cdk/build/libs/org.eclipse.xsmp.profile.esa_cdk-cli.jar ${{ github.workspace }}/org.eclipse.xsmp.profile.esa_cdk.cli-${{ github.ref_name }}.jar
mv ${{ github.workspace }}/vscode-extension/build/vscode/xsmp-modeler.vsix ${{ github.workspace }}/xsmp-modeler-${{ github.ref_name }}.vsix
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -50,8 +45,8 @@ jobs:
You can find additional Command Line utilities in the Assets.
files: |
${{ github.workspace }}/org.eclipse.xsmp.repository-${{ github.ref_name }}.zip
${{ github.workspace }}/xsmp-modeler-${{ github.ref_name }}.vsix
${{ github.workspace }}/org.eclipse.xsmp.tool.smp.cli-${{ github.ref_name }}.jar
${{ github.workspace }}/org.eclipse.xsmp.tool.python.cli-${{ github.ref_name }}.jar
${{ github.workspace }}/org.eclipse.xsmp.profile.xsmp_sdk.cli-${{ github.ref_name }}.jar
${{ github.workspace }}/org.eclipse.xsmp.profile.esa_cdk.cli-${{ github.ref_name }}.jar
${{ github.workspace }}/vscode-extension/build/vscode/xsmp-modeler-${{ github.ref_name }}.vsix
${{ github.workspace }}/org.eclipse.xsmp.tool.smp/build/libs/org.eclipse.xsmp.tool.smp-${{ github.ref_name }}-cli.jar
${{ github.workspace }}/org.eclipse.xsmp.tool.python/build/libs/org.eclipse.xsmp.tool.python-${{ github.ref_name }}-cli.jar
${{ github.workspace }}/org.eclipse.xsmp.profile.xsmp_sdk/build/libs/org.eclipse.xsmp.profile.xsmp_sdk-${{ github.ref_name }}-cli.jar
${{ github.workspace }}/org.eclipse.xsmp.profile.esa_cdk/build/libs/org.eclipse.xsmp.profile.esa_cdk-${{ github.ref_name }}-cli.jar
32 changes: 9 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ configure(subprojects.findAll { it.name.startsWith('org.eclipse.xsmp') }) {
//apply plugin: 'idea'

group = 'org.eclipse.xsmp'
version = '1.1.0-SNAPSHOT'

sourceCompatibility = '17'
targetCompatibility = '17'
Expand Down Expand Up @@ -68,7 +67,7 @@ configure(subprojects.findAll { it.name.equals('vscode-extension') }) {

task vscodeExtension(dependsOn: [npmInstall, npmInstallVsce], type: NodeTask) {
ext.destDir = new File(buildDir, 'vscode')
ext.archiveName = "xsmp-modeler.vsix"
ext.archiveName = "xsmp-modeler-${version}.vsix"
ext.destPath = "$destDir/$archiveName"
inputs.with {
files inputFiles
Expand All @@ -93,32 +92,19 @@ configure(subprojects.findAll { it.name.equals('vscode-extension') }) {

}

}
/*
updateVersion {
doLast {
// custom code
def versionPattern = /\d+.\d+(.\d+)?/
def encoding = 'UTF-8'
def filesToUpdate = [
new File('vscode-extension', 'package.json'),
new File('vscode-extension-self-contained', 'package.json'),
]
// String replacements - isn't long enough to justify advanced code ;)
filesToUpdate.forEach { file ->
String text = file.getText(encoding)
text = text.replaceAll("\"version\": \"$versionPattern\",", "\"version\": \"$project.version\",")
file.setText(text, encoding)
}
}
task updateVersion(type: NpmTask, dependsOn: npmSetup) {
group 'Node'
description 'Update VS Code extension version'
args = [ 'version', "${version}", '--allow-same-version' ]
}
}

/*
release {
tagTemplate = 'v${version}'
preTagCommitMessage = '[release] pre tag commit: '
tagCommitMessage = '[release] creating tag: '
newVersionCommitMessage = '[release] new version commit: '
failOnSnapshotDependencies = false
}*/
}
*/
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=1.1.0
1 change: 0 additions & 1 deletion org.eclipse.xsmp.ide/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ shadowJar {
'.options', '.api_description', '*.profile', '*.html', 'about.*', 'about_files/*',
'plugin.xml', 'systembundle.properties', 'profile.list')
archiveClassifier = 'ls'
archiveVersion = ''
append('plugin.properties')
mergeServiceFiles()
minimize()
Expand Down
1 change: 0 additions & 1 deletion org.eclipse.xsmp.profile.esa_cdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ shadowJar {
'.options', '.api_description', '*.profile', '*.html', 'about.*', 'about_files/*',
'plugin.xml', 'systembundle.properties', 'profile.list')
archiveClassifier = 'cli'
archiveVersion = ''
append('plugin.properties')
mergeServiceFiles()
minimize()
Expand Down
1 change: 0 additions & 1 deletion org.eclipse.xsmp.profile.xsmp_sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ shadowJar {
'.options', '.api_description', '*.profile', '*.html', 'about.*', 'about_files/*',
'plugin.xml', 'systembundle.properties', 'profile.list')
archiveClassifier = 'cli'
archiveVersion = ''
append('plugin.properties')
mergeServiceFiles()
minimize()
Expand Down
1 change: 0 additions & 1 deletion org.eclipse.xsmp.tool.python/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ shadowJar {
'.options', '.api_description', '*.profile', '*.html', 'about.*', 'about_files/*',
'plugin.xml', 'systembundle.properties', 'profile.list')
archiveClassifier = 'cli'
archiveVersion = ''
append('plugin.properties')
mergeServiceFiles()
minimize()
Expand Down
1 change: 0 additions & 1 deletion org.eclipse.xsmp.tool.smp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ shadowJar {
'.options', '.api_description', '*.profile', '*.html', 'about.*', 'about_files/*',
'plugin.xml', 'systembundle.properties', 'profile.list')
archiveClassifier = 'cli'
archiveVersion = ''
append('plugin.properties')
mergeServiceFiles()
minimize()
Expand Down

0 comments on commit 089e5f0

Please sign in to comment.