Commit ab3432ee authored by Timon Stampfli's avatar Timon Stampfli

ci devbuilds: use commithash for tagging

parent 63815e1f
......@@ -2,19 +2,41 @@ stages:
- build-deps
- build
- publish
build:
build-dev:
except:
- tags
stage: build
image: node:12
script:
- node ./setversion 0.0.0-$CI_COMMIT_SHORT_SHA
- npm ci
- npm run build-package
- mv soicode-*.vsix soicode-dev-$CI_COMMIT_SHORT_SHA.vsix
dependencies:
- build-helper
artifacts:
untracked: false
paths:
- soicode-dev-$CI_COMMIT_SHORT_SHA.vsix
expire_in: 30 day
build-release:
only:
- tags
stage: build
image: node:12
script:
- node ./setversion $CI_COMMIT_TAG
- npm ci
- npm run build-package
- mv soicode-*.vsix soicode-latest.vsix
- mv soicode-*.vsix soicode-$CI_COMMIT_TAG.vsix
dependencies:
- build-helper
artifacts:
untracked: false
paths:
- soicode-latest.vsix
- soicode-$CI_COMMIT_TAG.vsix
expire_in: 30 days
publish:
......@@ -23,10 +45,9 @@ publish:
stage: publish
image: node:10
script:
- npm run validateGitTag
- npx vsce publish -p $PUBLISHING_TOKEN --packagePath soicode-latest.vsix
- npx vsce publish -p $PUBLISHING_TOKEN --packagePath soicode-$CI_COMMIT_TAG.vsix
dependencies:
- build
- build-release
build-helper:
stage: build-deps
......@@ -37,7 +58,6 @@ build-helper:
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./dist/helper-linux-amd64 ./helper
- CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./dist/helper-windows-amd64.exe ./helper
- CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./dist/helper-darwin-amd64 ./helper
artifacts:
untracked: false
paths:
......
{
"name": "soicode",
"version": "0.8.17",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
......@@ -2,7 +2,7 @@
"name": "soicode",
"displayName": "soicode",
"description": "A extension which provides integration to solve soi (soi.ch) tasks in vscode",
"version": "0.8.17",
"version": "0.0.0",
"publisher": "swissolyinfo",
"engines": {
"vscode": "^1.33.0"
......@@ -264,7 +264,6 @@
"pretest": "npm run compile",
"build-package": "vsce package",
"test": "node ./out/test/runTest.js",
"validateGitTag": "if [ $npm_package_version != $CI_COMMIT_TAG ]; then exit 1; fi",
"vscode:prepublish": "webpack --mode production",
"webpack": "webpack --mode production"
},
......
const fs = require("fs");
const packageSpec = JSON.parse(fs.readFileSync("package.json").toString());
packageSpec.version = process.argv[2];
fs.writeFileSync("package.json", JSON.stringify(packageSpec, null, 2) + "\n");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment