Skip to content

Commit

Permalink
Merge branch 'main' into chore/surrealdb
Browse files Browse the repository at this point in the history
  • Loading branch information
fu050409 authored Nov 24, 2024
2 parents f42f3fe + bd0f97e commit a391fb4
Show file tree
Hide file tree
Showing 10 changed files with 1,637 additions and 4 deletions.
31 changes: 31 additions & 0 deletions .changes/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"gitSiteUrl": "https://github.com/swpu-acm/online-judge/",
"pkgManagers": {
"javascript": {
"version": true,
"getPublishedVersion": {
"use": "fetch:check",
"options": {
"url": "https://api.github.com/repos/swpu-acm/online-judge/git/refs/tags/online-judge-v${ pkg.pkgFile.version }"
}
},
"publish": ["npm publish --provenance --access public"]
},
"rust": {
"version": true,
"getPublishedVersion": {
"use": "fetch:check",
"options": {
"url": "https://api.github.com/repos/swpu-acm/online-judge/git/refs/tags/online-judge-v${ pkg.pkgFile.version }"
}
},
"publish": []
}
},
"packages": {
"online-judge": {
"path": ".",
"manager": "rust"
}
}
}
31 changes: 31 additions & 0 deletions .changes/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changes

##### via https://github.com/jbolda/covector

As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes.

When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.

Use the following format:

```md
---
"package-a": patch
"package-b": minor
---

Change summary goes here

```

Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed.

Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).

Given a version number MAJOR.MINOR.PATCH, increment the:

- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing).
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"words": [
"chrono",
"covector",
"dtolnay",
"farmfe",
"jbolda",
"signin",
"surrealdb"
]
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/covector-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: covector status
on: [pull_request]

jobs:
covector:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for use of git history
- name: covector status
uses: jbolda/covector/packages/[email protected]
id: covector
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: 'status'
comment: true
51 changes: 51 additions & 0 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: version or publish

on:
push:
branches:
- main

permissions:
# required for npm provenance
id-token: write
# required to create the GitHub Release
contents: write
# required for creating the Version Packages Release
pull-requests: write

jobs:
version-or-publish:
runs-on: ubuntu-latest
timeout-minutes: 65
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for use of git history
- uses: actions/setup-node@v4
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/[email protected]
id: covector
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: "version-or-publish"
createRelease: true
recognizeContributors: true
- name: Create Pull Request With Versions Bumped
id: cpr
uses: peter-evans/create-pull-request@v6
if: steps.covector.outputs.commandRan == 'version'
with:
title: "release: bump versions"
commit-message: "publish new versions"
labels: "version updates"
branch: "release"
body: ${{ steps.covector.outputs.change }}
10 changes: 8 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Test
on:
- push
- pull_request
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
Expand All @@ -15,4 +19,6 @@ jobs:
-p 5176:8000 \
surrealdb/surrealdb:latest start \
--user root --pass root
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- run: cargo test --verbose --all-features
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@

# Datas
/content

# Node.js
/node_modules
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "online-judge",
"version": "0.0.0",
"description": "Extremely fast async online judge backend based on Rust",
"scripts": {
"covector": "pnpm exec covector"
},
"keywords": [],
"author": "苏向夜 <[email protected]>",
"license": "AGPL-3.0-only",
"devDependencies": {
"covector": "^0.12.3"
}
}
Loading

0 comments on commit a391fb4

Please sign in to comment.