-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(merging): 'ci-refactor-build-flow' into 'main'
ci(gitlab-ci): 恢复手动触发打标签 See merge request sysu-gitlab/thesis-template/better-thesis!15
- Loading branch information
Showing
1 changed file
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
variables: | ||
CARGO_HOME: $CI_PROJECT_DIR/cargo | ||
|
||
default: | ||
image: rust | ||
cache: | ||
paths: | ||
- $CARGO_HOME | ||
before_script: | ||
- export PATH="$PATH:$CARGO_HOME/bin" | ||
- cargo install typst-cli git-cliff sd | ||
|
||
stages: | ||
- check | ||
- release | ||
|
||
# each merge request are required to ensure compiling the `.typ`s file successfully. | ||
check-typst-compile: | ||
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 | ||
- if: $CI_COMMIT_TAG | ||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH | ||
before_script: | ||
- export PATH="$PATH:$CARGO_HOME/bin" | ||
- cargo install typst-cli | ||
- if: $CI_COMMIT_TAG | ||
script: | ||
- typst compile | ||
--root=$CI_PROJECT_DIR | ||
|
@@ -29,6 +32,26 @@ check-typst-compile: | |
# paths: | ||
# - $CI_PROJECT_DIR/thesis_preview.pdf | ||
|
||
release-commit: | ||
stage: release | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH | ||
when: manual | ||
script: | ||
- | | ||
git config user.name $GITLAB_USER_NAME | ||
git config user.email $GITLAB_USER_EMAIL | ||
git remote set-url --push origin "https://sysu-bot:[email protected]/sysu-gitlab/thesis-template/better-thesis.git" | ||
- | | ||
VERSION=$(git cliff --bumped-version --unreleased) | ||
git cliff --bump --unreleased > release-note.md | ||
- | | ||
sd 'version = ".*"' 'version = "$VERSION"' $CI_PROJECT_DIR/typst.toml | ||
- | | ||
git add $CI_PROJECT_DIR/typst.toml && git commit -m "ci(release):$VERSION" | ||
git tag $VERSION -m --file=release-note.md | ||
git push --tags | ||
gitlab-release: | ||
stage: release | ||
image: registry.gitlab.com/gitlab-org/release-cli:latest | ||
|