Skip to content
Snippets Groups Projects
Commit 68ca18ac authored by Midhun Suresh's avatar Midhun Suresh
Browse files

Merge branch 'test-gitlab-ci' into 'main'

Use git-lab ci to do automatic build and release on tag creation

See merge request new-vector/modular/chatterbox!3
parents a77b65d8 0fe83bd6
No related branches found
No related tags found
No related merge requests found
# Uses latest NodeJS
image: node:latest
# And to cache them as well.
cache:
paths:
- node_modules/
- .yarn
# You specify the stages. Those are the steps that GitLab will go through
# Order matters.
stages:
- build
- upload
- release
variables:
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/releases"
Build:
stage: build
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created manually
before_script:
- yarn config set cache-folder .yarn
- yarn install
script:
- yarn build
- cd target
- tar -czvf ../chatterbox-$CI_COMMIT_TAG.tar.gz *
artifacts:
paths:
- chatterbox-$CI_COMMIT_TAG.tar.gz
expire_in: 1 hour
Upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
dependencies:
- Build
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "chatterbox-${CI_COMMIT_TAG}.tar.gz" "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/chatterbox-${CI_COMMIT_TAG}.tar.gz"
Release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"chatterbox-$CI_COMMIT_TAG.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/chatterbox-$CI_COMMIT_TAG.tar.gz\"}" \
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"scripts": { "scripts": {
"start": "vite", "start": "vite",
"build": "tsc && vite build && vite build --config parent-vite.config.js", "build": "tsc && vite build && vite build --config parent-vite.config.js && scripts/after-build.sh",
"preview": "vite preview" "preview": "vite preview"
}, },
"devDependencies": { "devDependencies": {
......
{ {
"homeserver": "http://localhost:8008", "homeserver": "https://matrix.midhun.dev",
"auto_join_room": "!KiuRShFqxJLSoshNKa:localhost:8008", "auto_join_room": "!XOUozZcpOvneVFsrGi:matrix.midhun.dev",
"username_prefix": "testcorp" "username_prefix": "foobar"
} }
#!/bin/bash
echo "Running after-build tasks ..."
find target/assets/ -name "parent.*.js" -exec rm -vf {} \;
find target/assets/ -name "parent.*.css" -exec rm -vf {} \;
rm -vf target/index.html
mv -v target/parent/assets/* target/assets/
rm -rfv target/parent
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment