test build
This commit is contained in:
parent
52b4e5ad2b
commit
f66c9ccfc2
3 changed files with 80 additions and 14 deletions
|
|
@ -1,14 +1,60 @@
|
||||||
variables:
|
|
||||||
VERSION_ID: '1.0:$CI_PIPELINE_ID'
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- Build
|
||||||
|
- Upload
|
||||||
|
- Release
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: crimata/electron-builder-mac
|
stage: Build
|
||||||
stage: build
|
image: electronuserland/builder:wine
|
||||||
|
before_script:
|
||||||
|
- yarn
|
||||||
|
script:
|
||||||
|
- export VERSION=$(node -e "console.log(require('./package.json').version)")
|
||||||
|
- echo "VERSION=$VERSION" >> variables.env
|
||||||
|
- export APPNAME=$(node -e "console.log(require('./package.json').productName)")
|
||||||
|
- echo "APPNAME=$APPNAME" >> variables.env
|
||||||
|
- npm run build
|
||||||
artifacts:
|
artifacts:
|
||||||
|
reports:
|
||||||
|
dotenv: variables.env
|
||||||
|
name: $CI_COMMIT_REF_SLUG
|
||||||
paths:
|
paths:
|
||||||
- $CI_PROJECT_DIR/dist/*.*
|
- $CI_PROJECT_DIR/dist/*.*
|
||||||
|
when: on_success
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
variables:
|
||||||
|
WIN_BINARY: '${APPNAME}-${VERSION}.exe'
|
||||||
|
PACKAGE_REGISTRY_URL: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${APPNAME}/${VERSION}'
|
||||||
|
|
||||||
|
upload:
|
||||||
|
stage: Upload
|
||||||
|
needs:
|
||||||
|
- job: build
|
||||||
|
artifacts: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
when: never # Do not run this job when a tag is created manually
|
||||||
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when when commits are pushed to the default branch
|
||||||
script:
|
script:
|
||||||
- yarn dist
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "./dist/${WIN_BINARY}" "${PACKAGE_REGISTRY_URL}/${WIN_BINARY}"'
|
||||||
|
|
||||||
|
auto-release-master:
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli
|
||||||
|
needs:
|
||||||
|
- job: build
|
||||||
|
artifacts: true
|
||||||
|
- job: upload
|
||||||
|
artifacts: true
|
||||||
|
stage: Release
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
when: never # Do not run this job when a tag is created manually
|
||||||
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when when commits are pushed to the default branch
|
||||||
|
script:
|
||||||
|
- echo "Release $VERSION"
|
||||||
|
- |
|
||||||
|
release-cli create --name "Release $VERSION" --tag-name v$VERSION \
|
||||||
|
--description 'Created using the release-cli. $CI_COMMIT_TITLE' --ref $CI_COMMIT_SHA \
|
||||||
|
--assets-link "{\"name\":\"${APPNAME}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${WIN_BINARY}\"}"
|
||||||
|
|
|
||||||
23
package.json
23
package.json
|
|
@ -20,11 +20,30 @@
|
||||||
"postuninstal": "electron-builder install-app-deps",
|
"postuninstal": "electron-builder install-app-deps",
|
||||||
"dist":"electron-builder --publish always",
|
"dist":"electron-builder --publish always",
|
||||||
"dev": "vue-cli-service electron:serve",
|
"dev": "vue-cli-service electron:serve",
|
||||||
"build": "vue-cli-service electron:build"
|
"build": "electron-builder --win"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type" : "git",
|
"type" : "git",
|
||||||
"url" : "https://gitlab.com/crimata/electron-app.git"
|
"url" : "https://gitlab.com/crimata/electron-app.git",
|
||||||
|
"release": "latest"
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"artifactName": "${productName}-${version}.${ext}",
|
||||||
|
"publish": {
|
||||||
|
"provider": "generic",
|
||||||
|
"url": "https://gitlab.com/api/v4/projects/25637892/jobs/artifacts/master/raw/dist?job=build"
|
||||||
|
},
|
||||||
|
"win": {
|
||||||
|
"target": [
|
||||||
|
"nsis"
|
||||||
|
],
|
||||||
|
"verifyUpdateCodeSignature": false
|
||||||
|
},
|
||||||
|
"linux": {
|
||||||
|
"target": [
|
||||||
|
"AppImage"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google-cloud/speech": "^4.2.0",
|
"@google-cloud/speech": "^4.2.0",
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ module.exports = {
|
||||||
builderOptions: {
|
builderOptions: {
|
||||||
// TODO electron-builder config https://www.electron.build/configuration/configuration
|
// TODO electron-builder config https://www.electron.build/configuration/configuration
|
||||||
appId: "com.crimata.messenger",
|
appId: "com.crimata.messenger",
|
||||||
productName: "Crimata Messenger"
|
productName: "Crimata Messenger",
|
||||||
|
|
||||||
},
|
},
|
||||||
preload: "src/preload.ts"
|
preload: "src/preload.ts"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue