Skip to content

Commit 5dfc324

Browse files
authored
Fix release actions (#136)
1 parent b6bd749 commit 5dfc324

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

.github/workflows/tagged_release.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ jobs:
100100
DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq -r '.assets[2].url')
101101
fi
102102
103-
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $DOWNLOAD_URL > backend/ame-backend.sh
104-
chmod 755 backend/ame-backend.sh
103+
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $DOWNLOAD_URL > backend/ame-backend-${{ github.event.inputs.release_version }}-mac
104+
chmod 755 backend/ame-backend-${{ github.event.inputs.release_version }}-mac
105105
106106
- name: Download aspect model service into project (Linux)
107107
if: matrix.os == 'ubuntu-20.04'
@@ -130,8 +130,8 @@ jobs:
130130
DOWNLOAD_URL=$(curl -sl --header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/eclipse-esmf/esmf-aspect-model-editor-backend/releases/tags/v${{ github.event.inputs.release_version }} | jq -r '.assets[2].url')
131131
fi
132132
133-
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $DOWNLOAD_URL > backend/ame-backend.sh
134-
chmod 755 backend/ame-backend.sh
133+
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/octet-stream" $DOWNLOAD_URL > backend/ame-backend-${{ github.event.inputs.release_version }}-linux
134+
chmod 755 backend/ame-backend-${{ github.event.inputs.release_version }}-linux
135135
136136
- name: Download aspect model service into project (Windows)
137137
if: matrix.os == 'windows-latest'
@@ -158,11 +158,6 @@ jobs:
158158
159159
# Remove the zip file
160160
Remove-Item -Path backend/ame-backend.zip
161-
162-
# Rename the extracted .exe file
163-
$oldName = "backend\ame-backend-${{ github.event.inputs.release_version }}-win.exe"
164-
$newName = "ame-backend.exe"
165-
Rename-Item -Path $oldName -NewName $newName
166161
} else {
167162
Write-Error "No zip file found."
168163
}

core/electron-libs/core.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const promises = require('./promisify');
1818
const portfinder = require('portfinder');
1919
const platformData = require('./os-checker');
2020
const {windowsManager} = require('./windows-manager');
21+
const projectVersion = require('../package.json').version;
2122

2223
/**
2324
* @type string[]
@@ -62,7 +63,7 @@ function startService() {
6263
const rootPath = path.join(__dirname, '..', '..', '..', 'backend');
6364
if (processes.length === 0) {
6465
global.backendPort = port;
65-
const process = spawn(path.join(rootPath, `ame-backend${platformData.extension}`), [`-Dserver.port=${port}`]);
66+
const process = spawn(path.join(rootPath, `ame-backend-${projectVersion}-${platformData.extension}`), [`-Dserver.port=${port}`]);
6667

6768
process.stdout.on('data', data => {
6869
if (data.includes(`Tomcat started on port(s): ${port}`)) {

core/electron-libs/os-checker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
module.exports = {
1515
os: process.platform,
16-
extension: process.platform === 'win32' ? '.exe' : '.sh',
16+
extension: process.platform === 'win32' ? 'win.exe' : process.platform === 'darwin' ? 'mac' : 'linux',
1717
isWin: process.platform === 'win32',
1818
isLinux: process.platform === 'linux',
1919
isMac: process.platform === 'darwin',

0 commit comments

Comments
 (0)