Update .gitlab-ci.yml file
This commit is contained in:
41
.gitlab-ci.yml
Normal file
41
.gitlab-ci.yml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- release
|
||||||
|
|
||||||
|
build-zip:
|
||||||
|
stage: build
|
||||||
|
image: alpine:latest
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG =~ /-submission$/
|
||||||
|
before_script:
|
||||||
|
- apk add --no-cache zip
|
||||||
|
script:
|
||||||
|
- SHEET_NAME="${CI_COMMIT_TAG%-submission}"
|
||||||
|
- echo "SHEET_NAME=$SHEET_NAME" >> variables.env
|
||||||
|
- |
|
||||||
|
if [ ! -d "$SHEET_NAME" ]; then
|
||||||
|
echo "Error: Directory $SHEET_NAME does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- cd "$SHEET_NAME"
|
||||||
|
- zip -r "../${SHEET_NAME}.zip" .
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- "*.zip"
|
||||||
|
reports:
|
||||||
|
dotenv: variables.env
|
||||||
|
|
||||||
|
release-zip:
|
||||||
|
stage: release
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
needs:
|
||||||
|
- job: build-zip
|
||||||
|
artifacts: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG =~ /-submission$/
|
||||||
|
script:
|
||||||
|
- echo "Creating release for $SHEET_NAME"
|
||||||
|
release:
|
||||||
|
name: "Submission: $SHEET_NAME"
|
||||||
|
tag_name: $CI_COMMIT_TAG
|
||||||
|
description: "Automated release for $SHEET_NAME"
|
||||||
Reference in New Issue
Block a user