File tree 1 file changed +33
-10
lines changed
1 file changed +33
-10
lines changed Original file line number Diff line number Diff line change
1
+ variables :
2
+ CARGO_HOME : $CI_PROJECT_DIR/cargo
3
+
4
+ default :
5
+ image : rust
6
+ cache :
7
+ paths :
8
+ - $CARGO_HOME
9
+ before_script :
10
+ - export PATH="$PATH:$CARGO_HOME/bin"
11
+ - cargo install typst-cli git-cliff sd
12
+
1
13
stages :
2
14
- check
3
15
- release
4
16
5
17
# each merge request are required to ensure compiling the `.typ`s file successfully.
6
18
check-typst-compile :
7
19
stage : check
8
- image : rust
9
- variables :
10
- CARGO_HOME : $CI_PROJECT_DIR/cargo
11
- cache :
12
- paths :
13
- - $CARGO_HOME
14
20
rules :
15
21
- if : $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
16
- - if : $CI_COMMIT_TAG
17
22
- if : $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
18
- before_script :
19
- - export PATH="$PATH:$CARGO_HOME/bin"
20
- - cargo install typst-cli
23
+ - if : $CI_COMMIT_TAG
21
24
script :
22
25
- typst compile
23
26
--root=$CI_PROJECT_DIR
@@ -29,6 +32,26 @@ check-typst-compile:
29
32
# paths:
30
33
# - $CI_PROJECT_DIR/thesis_preview.pdf
31
34
35
+ release-commit :
36
+ stage : release
37
+ rules :
38
+ - if : $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
39
+ when : manual
40
+ script :
41
+ - |
42
+ git config user.name $GITLAB_USER_NAME
43
+ git config user.email $GITLAB_USER_EMAIL
44
+ git remote set-url --push origin "https://sysu-bot:[email protected] /sysu-gitlab/thesis-template/better-thesis.git"
45
+ - |
46
+ VERSION=$(git cliff --bumped-version --unreleased)
47
+ git cliff --bump --unreleased > release-note.md
48
+ - |
49
+ sd 'version = ".*"' 'version = "$VERSION"' $CI_PROJECT_DIR/typst.toml
50
+ - |
51
+ git add $CI_PROJECT_DIR/typst.toml && git commit -m "ci(release):$VERSION"
52
+ git tag $VERSION -m --file=release-note.md
53
+ git push --tags
54
+
32
55
gitlab-release :
33
56
stage : release
34
57
image : registry.gitlab.com/gitlab-org/release-cli:latest
You can’t perform that action at this time.
0 commit comments