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
2e551386 History
.gitlab-ci.yml 1.2 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 only:
19 - master # Run this job only when changes are pushed to the master branch
20 after_script:
21 # Save the job ID in a .env file to be used by the next job
22 - echo "BUILD_JOB_ID=$CI_JOB_ID" >> build_job.env
23
24release_job:
25 stage: release
26 image: registry.gitlab.com/gitlab-org/release-cli:latest
27 script:
28 - echo "running release_job for $TAG"
29 release:
30 name: 'v0.$CI_PIPELINE_IID'
31 tag_name: 'v0.$CI_PIPELINE_IID' # The version is incremented per pipeline.
32 description: 'v0.$CI_PIPELINE_IID'
33 ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA.
34 assets:
35 links:
36 - name: 'framework.js'
37 url: "https://gitlab.com/${CI_PROJECT_PATH}/-/jobs/$BUILD_JOB_ID/artifacts/file/js/framework.js"
38 only:
39 - master # Run this job only when changes are pushed to the master branch