Skip to content

Commit

Permalink
Merge branch 'hznuoj-dev:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
daizeyao authored Mar 19, 2024
2 parents 01170d3 + c0c6cb1 commit 03e8439
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4

[*.yml]
indent_size = 2
35 changes: 35 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tag on Version Change
on:
push:
branches:
- master
workflow_dispatch:

jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check Version
id: check_version
shell: bash
run: |
if [[ -f VERSION ]]; then
version=$(cat VERSION)
tags=$(git tag --list)
echo $tags
if [[ ! "$tags" =~ (^|[[:space:]])"$version"($|[[:space:]]) ]]; then
echo $version
echo "::set-output name=tag::$version"
fi
fi
- name: Create Tag
if: ${{ startsWith(steps.check_version.outputs.tag, 'v') }}
run: |
git tag ${{ steps.check_version.outputs.tag }}
git push origin ${{ steps.check_version.outputs.tag }}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ docker exec -it hznuoj bash

[gh-release-badge]: https://img.shields.io/github/release/hznuoj-dev/hznuoj.svg
[gh-release]: https://GitHub.com/hznuoj-dev/hznuoj/releases/

## 发布

* 将改动提交一个 PR
* 在 PR 中,修改 [VERSION](./VERSION) 中的版本号,版本号要满足 `vx.x.x` 的格式,如果能满足 [语义化版本](https://semver.org/lang/zh-CN/) 的话更好
* 当 PR merge 到 master 的时候,如果 [VERSION](./VERSION) 里的版本号不存在于 git tag 中,那么会触发版本发布,会自动构建一个 docker image
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.0.8

0 comments on commit 03e8439

Please sign in to comment.