fix desktop app releasing (#2116)
* fix app releasing * fix sed for macos * fix setting app version on all oses
This commit is contained in:
parent
5cc97483e0
commit
03edc197d3
16
.github/workflows/build-and-release-desktop.yml
vendored
16
.github/workflows/build-and-release-desktop.yml
vendored
@ -60,6 +60,10 @@ jobs:
|
||||
run: yarn build
|
||||
working-directory: "desktop/local-app"
|
||||
|
||||
- name: "Set desktop app version"
|
||||
run: node helpers/set-version.js
|
||||
working-directory: "desktop/electron"
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: yarn install --froze-lockfile
|
||||
working-directory: "desktop/electron"
|
||||
@ -68,15 +72,19 @@ jobs:
|
||||
run: yarn build
|
||||
working-directory: "desktop/electron"
|
||||
|
||||
- name: "Build app"
|
||||
run: yarn bundle --publish never
|
||||
- name: "Install electron tools"
|
||||
run: yarn electron-builder install-app-deps
|
||||
working-directory: "desktop/electron"
|
||||
|
||||
- name: "Build app for testing"
|
||||
run: yarn electron-builder --publish never
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
working-directory: "desktop/electron"
|
||||
if: ${{ github.event_name != 'release' }}
|
||||
|
||||
- name: "Build & publish App"
|
||||
run: yarn release
|
||||
- name: "Build & release app"
|
||||
run: yarn electron-builder --publish always
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
working-directory: "desktop/electron"
|
||||
|
@ -28,5 +28,4 @@ publish:
|
||||
provider: github
|
||||
owner: thecodingmachine
|
||||
repo: workadventure
|
||||
vPrefixedTagName: false
|
||||
releaseType: draft
|
||||
releaseType: release
|
||||
|
18
desktop/electron/helpers/set-version.js
Normal file
18
desktop/electron/helpers/set-version.js
Normal file
@ -0,0 +1,18 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
let version = '0.0.0';
|
||||
|
||||
if (process.env.GITHUB_REF.startsWith('refs/tags/v')) {
|
||||
version = process.env.GITHUB_REF.replace('refs/tags/v', '');
|
||||
}
|
||||
|
||||
console.log('Version:', version);
|
||||
|
||||
const packageJsonPath = path.resolve(__dirname, '..', 'package.json');
|
||||
|
||||
let data = fs.readFileSync(packageJsonPath, 'utf8');
|
||||
|
||||
data = data.replace('managedbyci', version);
|
||||
|
||||
fs.writeFileSync(packageJsonPath, data);
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "workadventure-desktop",
|
||||
"version": "1.0.0",
|
||||
"version": "managedbyci",
|
||||
"description": "Desktop application for WorkAdventure",
|
||||
"author": "thecodingmachine",
|
||||
"main": "dist/main.js",
|
||||
@ -11,7 +11,6 @@
|
||||
"dev": "yarn build --watch --onSuccess 'yarn electron dist/main.js'",
|
||||
"dev:local-app": "cd ../local-app && yarn && yarn dev",
|
||||
"bundle": "yarn build:local-app && yarn build && electron-builder install-app-deps && electron-builder",
|
||||
"release": "yarn bundle",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "exit 0",
|
||||
"lint": "yarn eslint src/ . --ext .ts",
|
||||
|
Loading…
Reference in New Issue
Block a user