Skip to content
Snippets Groups Projects
Commit 8416f1ff authored by ewbo4360's avatar ewbo4360 :sunflower:
Browse files

trying to patch the artifact publishing

parent 20326166
No related branches found
No related tags found
No related merge requests found
Pipeline #74551 failed
......@@ -13,7 +13,7 @@
stages:
- build
- test
- publish
- publish-artifacts
cache:
paths:
......@@ -26,13 +26,18 @@
# the 2 following steps make sure that the required building tool (meson) is installed on the runner
#and also that all the other external dependencies are here (this will be part of a container later)
- apt-get update # Make sure the package lists are updated
- apt update
- apt-get upgrade -y
- apt upgrade -y
#install all necessary dependencies
- apt-get install python3-pip -y
- apt-get install meson -y
- apt-get install -y ccache
- apt-get install -y cmake
- apt-get install -y ninja-build
- apt install -y ca-certificates
- update-ca-certificates
- apt install -y curl
- apt-get install -y libfmt-dev
- apt-get install -y libgtest-dev
- apt-get install -y libpcre2-dev
......@@ -69,21 +74,26 @@
build-job :
stage: build
# rules:
# - if: '$CI_COMMIT_BRANCH == "main" && $CI_COMMIT_TAG == null'
image: ubuntu:24.04
script:
- echo "Hello, $GITLAB_USER_LOGIN! This is a build job"
- mkdir -p ./artifacts
- meson compile -C output/full --verbose
# artifacts:
# paths:
# - output/full # Publish the built artifacts
artifacts:
paths:
- ./artifacts # Publish the built artifacts
expire_in: 300 sec
cache:
paths:
- output/full #save cache for later jobs
test-job1:
stage: test
# rules:
# - if: '$CI_COMMIT_BRANCH == "main" && $CI_COMMIT_TAG == null'
image: ubuntu:24.04
script:
- echo "This job is for untit-tests"
......@@ -96,6 +106,8 @@
test-job2:
stage: test
# rules:
# - if: '$CI_COMMIT_BRANCH == "main" && $CI_COMMIT_TAG == null'
image: ubuntu:24.04
script:
- echo "This job is for general tests"
......@@ -107,20 +119,33 @@
paths:
- output/full #reuse the build cache :)
upload:
stage: publish
to-registry:
stage: publish-artifacts
# rules:
# - if: '$CI_COMMIT_BRANCH == "main" && $CI_COMMIT_TAG == null'
image: ubuntu:24.04
dependencies:
- build-job
script:
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch."
- echo "Publishing the artifact..."
# - cp -r output/full ./artifacts # Ensure the artifacts are included for deployment
- |
for artifact in ./artifacts/*; do
chmod +x ${artifact}
curl \
--header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--upload-files ${artifact} \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/artifacts/${version}/"
done
environment: production
cache:
paths:
- output/full #reuse the build cache :)
artifacts:
when: on_failure
access: all
expire_in: 301 sec
paths :
- ./artifacts # Publish the artifact(s) to GitLab
# artifacts:
# when: on_failure
# access: all
# expire_in: 301 sec
# paths :
# - ./artifacts # Publish the artifact(s) to GitLab
\ No newline at end of file
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