Skip to content
Snippets Groups Projects
Commit 900f668d authored by Philipp Stadler's avatar Philipp Stadler
Browse files

feat: first attempt at automatic tagging on main

parent 42e78c52
No related branches found
No related tags found
1 merge request!2feat: first attempt at automatic tagging on main
Pipeline #9587 failed
......@@ -3,6 +3,7 @@ image: durcheinander/sinologie-anki-pack-build:latest
stages:
- lint
- build
- publish
default:
cache:
......@@ -29,3 +30,22 @@ build-release:
# release both the archive and the uncompressed build directory
# (sinologie-anki-pack-*.zip would release just the zip)
- sinologie-anki-pack-*
publish-package-json-version-as-git-tag:
stage: publish
only:
refs:
- main
script:
- NPM_VERSION=$(grep '"version":' package.json -m 1 | cut -d '"' -f 4)
- MATCHING_GIT_TAG=$(git tag | grep ^NPM_VERSION$)
- if [ -z $MATCHING_GIT_TAG ]; then
- echo adding git tag for first commit on main with NPM version ${NPM_VERSION}
- git remote remove origin
- git remote add origin https://oauth:${REPOSITORY_ACCESS_TOKEN}@gitlab.phaidra.org/kartenaale/sinologie-anki-pack.git
- git config user.email Cao Cao
- git config user.name cao.cao@ci.kartenaale
- git tag -a $NPM_VERSION -m "Release $NPM_VERSION"
- else
- ' echo package-json-tag: keeping older tag for $NPM_VERSION'
- fi
\ No newline at end of file
......@@ -10,6 +10,7 @@ pipenv \
nodejs \
npm \
make \
zip
zip \
git
RUN npm install --global yarn
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment