-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into wcy/decompress_for_file_source
- Loading branch information
Showing
749 changed files
with
24,004 additions
and
11,469 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
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Package Version Checker | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
compare-package-version-with-latest-release-version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: List branches | ||
run: | | ||
git fetch --all | ||
release_branches=$(git branch -r | grep -E 'origin/release-[0-9]+\.[0-9]+' | sed 's/origin\///') | ||
echo "Release branches:" | ||
echo "$release_branches" | ||
echo "$release_branches" > release_branches.txt | ||
- name: Pick latest release branch | ||
run: | | ||
release_branches=$(cat release_branches.txt) | ||
latest_branch=$(echo "$release_branches" | sort -t. -k1,1 -k2,2 -Vr | head -n 1) | ||
echo "Latest release branch: $latest_branch" | ||
latest_version=$(echo "$latest_branch" | sed -E 's/release-([0-9]+\.[0-9]+)/\1/' | sed 's/^[ \t]*//') | ||
echo "Latest release version: $latest_version" | ||
echo "$latest_version" > latest_release_version.txt | ||
- name: Read Cargo.toml version | ||
run: | | ||
cargo_version=$(grep -oP '(?<=^version = ")[0-9]+\.[0-9]+' Cargo.toml) | ||
echo "Cargo.toml version: $cargo_version" | ||
echo "$cargo_version" > cargo_version.txt | ||
- name: Compare versions | ||
run: | | ||
latest_version=$(cat latest_release_version.txt) | ||
cargo_version=$(cat cargo_version.txt) | ||
latest_major=$(echo $latest_version | cut -d. -f1) | ||
latest_minor=$(echo $latest_version | cut -d. -f2) | ||
cargo_major=$(echo $cargo_version | cut -d. -f1) | ||
cargo_minor=$(echo $cargo_version | cut -d. -f2) | ||
if [ "$cargo_major" -lt "$latest_major" ] || { [ "$cargo_major" -eq "$latest_major" ] && [ "$cargo_minor" -le "$latest_minor" ]; }; then | ||
echo "Error: Cargo.toml package version $cargo_version is not larger than $latest_version" | ||
exit 1 | ||
else | ||
echo "Cargo.toml version $cargo_version is larger than or equal to $latest_version" | ||
fi |
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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Usage: install pre-commit, and then run `pre-commit install` to install git hooks | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: local | ||
hooks: | ||
- id: rustfmt | ||
name: rustfmt | ||
entry: rustfmt --edition 2021 | ||
language: system | ||
types: [rust] | ||
- id: typos | ||
name: typos | ||
entry: typos -w | ||
language: system | ||
- id: cargo sort | ||
name: cargo sort | ||
entry: cargo sort -g -w | ||
language: system | ||
files: 'Cargo.toml' | ||
pass_filenames: false |
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
Oops, something went wrong.