]> Repos - mime-chat/commitdiff
cicd
authorAndrew Gundersen <gundersena@xavier.edu>
Thu, 15 Apr 2021 13:56:16 +0000 (08:56 -0500)
committerAndrew Gundersen <gundersena@xavier.edu>
Thu, 15 Apr 2021 13:56:16 +0000 (08:56 -0500)
.gitlab-ci.yml

index ebd9da8587b3871c197fefc4d20fefdffe11981a..951f12a771b8178a31e6fb4d1426d48f7b7d6617 100644 (file)
@@ -6,20 +6,22 @@ stages:
 build:
   stage: Build
   tags:
+    # Use a macos runner to build.
     - darwin
+  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
-    - cd ~/Documents/crimata-electron
     - yarn electron:build
   artifacts:
     reports:
       dotenv: variables.env
     name: $CI_COMMIT_REF_SLUG
     paths:
-      - $CI_PROJECT_DIR/dist_electron/*.*
+      - dist_electron/
     when: on_success
   only:
     - main
@@ -28,6 +30,7 @@ variables:
   PACKAGE: '${APPNAME}-${VERSION}.dmg'
   PACKAGE_REGISTRY_URL: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${APPNAME}/${VERSION}'
 
+# Upload package to gitlab registry.
 upload:
   stage: Upload
   needs:
@@ -38,6 +41,7 @@ upload:
       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:
+    # Take the package we built and place it in the package registry.
     - 'curl --header "JOB-TOKEN: $CI_DEPLOY_PASSWORD" --upload-file "./dist_electron/${PACKAGE}" "${PACKAGE_REGISTRY_URL}/${PACKAGE}"'
 
 auto-release-master: