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
|
run: yarn build
|
||||||
working-directory: "desktop/local-app"
|
working-directory: "desktop/local-app"
|
||||||
|
|
||||||
|
- name: "Set desktop app version"
|
||||||
|
run: node helpers/set-version.js
|
||||||
|
working-directory: "desktop/electron"
|
||||||
|
|
||||||
- name: "Install dependencies"
|
- name: "Install dependencies"
|
||||||
run: yarn install --froze-lockfile
|
run: yarn install --froze-lockfile
|
||||||
working-directory: "desktop/electron"
|
working-directory: "desktop/electron"
|
||||||
@ -68,15 +72,19 @@ jobs:
|
|||||||
run: yarn build
|
run: yarn build
|
||||||
working-directory: "desktop/electron"
|
working-directory: "desktop/electron"
|
||||||
|
|
||||||
- name: "Build app"
|
- name: "Install electron tools"
|
||||||
run: yarn bundle --publish never
|
run: yarn electron-builder install-app-deps
|
||||||
|
working-directory: "desktop/electron"
|
||||||
|
|
||||||
|
- name: "Build app for testing"
|
||||||
|
run: yarn electron-builder --publish never
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
working-directory: "desktop/electron"
|
working-directory: "desktop/electron"
|
||||||
if: ${{ github.event_name != 'release' }}
|
if: ${{ github.event_name != 'release' }}
|
||||||
|
|
||||||
- name: "Build & publish App"
|
- name: "Build & release app"
|
||||||
run: yarn release
|
run: yarn electron-builder --publish always
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
working-directory: "desktop/electron"
|
working-directory: "desktop/electron"
|
||||||
|
@ -28,5 +28,4 @@ publish:
|
|||||||
provider: github
|
provider: github
|
||||||
owner: thecodingmachine
|
owner: thecodingmachine
|
||||||
repo: workadventure
|
repo: workadventure
|
||||||
vPrefixedTagName: false
|
releaseType: release
|
||||||
releaseType: draft
|
|
||||||
|
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",
|
"name": "workadventure-desktop",
|
||||||
"version": "1.0.0",
|
"version": "managedbyci",
|
||||||
"description": "Desktop application for WorkAdventure",
|
"description": "Desktop application for WorkAdventure",
|
||||||
"author": "thecodingmachine",
|
"author": "thecodingmachine",
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
@ -11,7 +11,6 @@
|
|||||||
"dev": "yarn build --watch --onSuccess 'yarn electron dist/main.js'",
|
"dev": "yarn build --watch --onSuccess 'yarn electron dist/main.js'",
|
||||||
"dev:local-app": "cd ../local-app && yarn && yarn dev",
|
"dev:local-app": "cd ../local-app && yarn && yarn dev",
|
||||||
"bundle": "yarn build:local-app && yarn build && electron-builder install-app-deps && electron-builder",
|
"bundle": "yarn build:local-app && yarn build && electron-builder install-app-deps && electron-builder",
|
||||||
"release": "yarn bundle",
|
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"test": "exit 0",
|
"test": "exit 0",
|
||||||
"lint": "yarn eslint src/ . --ext .ts",
|
"lint": "yarn eslint src/ . --ext .ts",
|
||||||
|
Loading…
Reference in New Issue
Block a user