Skip to content
Snippets Groups Projects
Commit 92e84a6b authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

Add package registration on tag issue

parent fcb73bcc
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,9 @@ image: julia:latest ...@@ -3,7 +3,9 @@ image: julia:latest
stages: stages:
- documentation - documentation
- deploy - deploy
- register
# Documentation stage
build documentation: build documentation:
stage: documentation stage: documentation
script: script:
...@@ -16,6 +18,7 @@ build documentation: ...@@ -16,6 +18,7 @@ build documentation:
only: only:
- main - main
# Deploy stage for GitLab Pages
pages: pages:
stage: deploy stage: deploy
script: script:
...@@ -24,4 +27,44 @@ pages: ...@@ -24,4 +27,44 @@ pages:
paths: paths:
- public - public
only: only:
- main - main
register package:
stage: register
before_script:
# Install git
- apt-get update && apt-get install -y git
# Ensure we're in the package root directory
- cd $CI_PROJECT_DIR
# Clone the registry repository
- git clone https://${REGISTRY_TOKEN}@git.nilu.no/julia/registry.git /tmp/registry
# Set Git user name and email
- git config --global user.name "Registry Bot"
- git config --global user.email "bot@git.nilu.no"
script:
# Use a temporary Julia environment for LocalRegistry
- julia -e '
using Pkg;
Pkg.activate(temp=true);
Pkg.add("LocalRegistry");
using LocalRegistry;
LocalRegistry.register(
registry = "/tmp/registry",
commit = true,
push = false,
ignore_reregistration = false,
allow_package_dirty = true
);
'
# Push changes to the registry
- |
cd /tmp/registry
git push https://gitlab-ci-token:$REGISTRY_TOKEN@git.nilu.no/julia/registry.git main
only:
- tags
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