BlueGit

timfa frameworkv3

Files

frameworkv3 / .gitlab-ci.yml

.gitlab-ci.yml

Update .gitlab-ci.yml file
timfa Tim Falken · pushed by timfa · 2 years ago
845aa0e7 History
.gitlab-ci.yml 1.3 KiB Download Raw
1# .gitlab-ci.yml
2
3# Define stages for the pipeline
4stages:
5 - build
6 - release
7
8# Define a job that runs when something is pushed to the master branch
9build_job:
10 stage: build
11 script:
12 - apt-get update -qy
13 - chmod +x ./glbuild.sh # Ensure the script is executable
14 - ./glbuild.sh # Execute the script
15 artifacts:
16 paths:
17 - js/framework.js
18 reports:
19 dotenv: build_job.env
20 only:
21 - master # Run this job only when changes are pushed to the master branch
22 after_script:
23 # Save the job ID in a .env file to be used by the next job
24 - echo "BUILD_JOB_ID=$CI_JOB_ID" >> build_job.env
25
26release_job:
27 stage: release
28 image: registry.gitlab.com/gitlab-org/release-cli:latest
29 dependencies:
30 - build_job
31 script:
32 - echo "running release_job for $TAG"
33 release:
34 name: 'v0.$CI_PIPELINE_IID'
35 tag_name: 'v0.$CI_PIPELINE_IID' # The version is incremented per pipeline.
36 description: 'v0.$CI_PIPELINE_IID'
37 ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA.
38 assets:
39 links:
40 - name: 'framework.js'
41 url: "https://gitlab.com/${CI_PROJECT_PATH}/-/jobs/$BUILD_JOB_ID/artifacts/file/js/framework.js"
42 only:
43 - master # Run this job only when changes are pushed to the master branch
44 before_script:
45 - source build_job.env