Skip to content

Commit

Permalink
chore(merging): 'ci-refactor-build-flow' into 'main'
Browse files Browse the repository at this point in the history
ci(gitlab-ci): 修复CI脚本复用问题

See merge request sysu-gitlab/thesis-template/better-thesis!8
  • Loading branch information
huangjj27 committed May 17, 2024
2 parents 69ebc8c + 7677700 commit 8036ec0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
30 changes: 18 additions & 12 deletions .gitlab/ci.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
image: rust
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo

cache:
paths:
- $CARGO_HOME

stages:
- check
- release

before_script:
- export PATH="$PATH:$CARGO_HOME/bin"
- cargo install typst-cli git-cliff sd

# each merge request are required to ensure compiling the `.typ`s file successfully.
check-merge-request:
stage: check
image: rust
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
cache:
paths:
- $CARGO_HOME
rules:
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
before_script:
- export PATH="$PATH:$CARGO_HOME/bin"
- cargo install typst-cli git-cliff sd
script:
- typst compile --root=$CI_PROJECT_DIR --font-path=$CI_PROJECT_DIR/fonts $CI_PROJECT_DIR/template/thesis.typ

check-default-branch:
stage: check
image: rust
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
cache:
paths:
- $CARGO_HOME
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
before_script:
- export PATH="$PATH:$CARGO_HOME/bin"
- cargo install typst-cli git-cliff sd
script:
- typst compile --root=$CI_PROJECT_DIR --font-path=$CI_PROJECT_DIR/fonts $CI_PROJECT_DIR/template/thesis.typ $CI_PROJECT_DIR/thesis_preview.pdf
# TODO(#1): the preview pdf should be generated by template repo
Expand Down
1 change: 1 addition & 0 deletions .gitlab/merge_request_templates/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [ ] 最后一个提交已更新 `CHANGELOG.md`:
```sh
git cliff --unreleased --tag $BUMPED_VERSION --prepend CHANGELOG.md -- --newest
git add CHANGELOG.md
```
- [ ] 最后一个提交的提交信息符合 `chore(release): $BUMPED_VERSION`
```sh
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [0.1.1-alpha.3] - 2024-05-17

### ⚙️ Miscellaneous Tasks

- *(gitlab-ci)* 修复CI脚本复用问题

## [0.1.1-alpha.2] - 2024-05-17

### 📚 Documentation
Expand Down
2 changes: 1 addition & 1 deletion typst.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "morden-sysu-thesis"
version = "0.1.1-alpha.2"
version = "0.1.1-alpha.3"
entrypoint = "lib.typ"
repository = "https://gitlab.com/sysu-gitlab/thesis-template/better-thesis"
authors = ["howardlau1999 <@howardlau1999>", "Sunny Huang <@huangjj27>"]
Expand Down

0 comments on commit 8036ec0

Please sign in to comment.