Skip to content

Commit 2b782e9

Browse files
committed
chore: Merge branch 'release/0.8.0'
2 parents 180e121 + 22ecb60 commit 2b782e9

File tree

121 files changed

+1601
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+1601
-402
lines changed

.github/scripts/bump-version.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
if [ "$#" -ne 2 ]; then
4+
echo "Usage: $0 <old version> <new version>"
5+
exit 1
6+
fi
7+
8+
OLD_VERSION=$1
9+
NEW_VERSION=$2
10+
ERROR_CODE=0
11+
12+
if [[ "$OSTYPE" == "darwin"* ]]; then
13+
SED_CMD=("sed" "-i" "")
14+
else
15+
SED_CMD=("sed" "-i")
16+
fi
17+
18+
cat .github/scripts/files-with-current-version-string | xargs -I % "${SED_CMD[@]}" s/$OLD_VERSION/$NEW_VERSION/g % || ERROR_CODE=2
19+
20+
if [ "$ERROR_CODE" -ne 0 ]; then
21+
echo "Error: An error while replacing version strings."
22+
exit $ERROR_CODE
23+
fi
24+
25+
echo "Version bumped from $OLD_VERSION to $NEW_VERSION"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
README.md
2+
midi2/Cargo.toml
3+
midi2_proc/Cargo.toml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git tag --sort=committerdate | grep -E "^[0-9]+\.[0-9]+\.[0-9]$" | tail -n 1

.github/scripts/setup-git-flow.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
sudo apt-get update
4+
sudo apt-get install -y git-flow
5+
6+
git fetch origin
7+
git switch --track origin/main
8+
git switch --track origin/develop
9+
10+
git config --global user.email "ben_leadbetter@hotmail.com"
11+
git config --global user.name "CI"
12+
13+
git config gitflow.branch.master main
14+
git config gitflow.branch.develop develop
15+
git config gitflow.prefix.feature feature/
16+
git config gitflow.prefix.bugfix bugfix/
17+
git config gitflow.prefix.release release/
18+
git config gitflow.prefix.hotfix hotfix/
19+
git config gitflow.prefix.support support/
20+
git config gitflow.prefix.versiontag ""
21+
git config gitflow.path.hooks ""

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ "main", "develop" ]
6+
pull_request:
7+
branches: [ "main", "develop" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Run tests
21+
run: cargo test --verbose --all-features
22+
23+
deny:
24+
runs-on: ubuntu-24.04
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: EmbarkStudios/cargo-deny-action@v1
28+
with:
29+
command: check all
30+
manifest-path: midi2/Cargo.toml
31+
32+
clippy:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Install Clippy
37+
run: rustup component add clippy
38+
- name: Clippy version
39+
run: cargo clippy --version
40+
- name: Run Clippy
41+
run: cargo clippy --all-features -- -D warnings

.github/workflows/finish-release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Finish release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Semver version to release
8+
required: true
9+
type:
10+
description: What type of release
11+
required: true
12+
default: 'release'
13+
type: choice
14+
options:
15+
- release
16+
- hotfix
17+
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
22+
jobs:
23+
release-finish:
24+
name: Finish release
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
ref: ${{ github.event.inputs.type }}/${{ github.event.inputs.version }}
32+
- name: Check semver
33+
uses: obi1kenobi/cargo-semver-checks-action@v2
34+
with:
35+
verbose: true
36+
- name: Setup git-flow
37+
run: ./.github/scripts/setup-git-flow.sh
38+
- name: Finish release
39+
run: git flow ${{ github.event.inputs.type }} finish ${{ github.event.inputs.version }} -m ${{ github.event.inputs.version }} --push
40+
- name: Publish midi2_proc
41+
uses: ryohidaka/action-cargo-publish@v0.1.0
42+
with:
43+
path: midi2_proc
44+
token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
45+
- name: Publish midi2
46+
uses: ryohidaka/action-cargo-publish@v0.1.0
47+
with:
48+
path: midi2
49+
token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/rust.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/start-release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Start release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Semver version to release
8+
required: true
9+
type:
10+
description: What type of release
11+
required: true
12+
default: 'release'
13+
type: choice
14+
options:
15+
- release
16+
- hotfix
17+
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
22+
jobs:
23+
release-start:
24+
name: Release start
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
- name: Setup git-flow
32+
run: ./.github/scripts/setup-git-flow.sh
33+
- name: Start release
34+
run: git flow ${{ github.event.inputs.type }} start ${{ github.event.inputs.version }}
35+
- name: Determine last release
36+
run: echo "LAST_RELEASE=$(./.github/scripts/last-released-version.sh)" >> $GITHUB_ENV
37+
- name: Bump version
38+
run: ./.github/scripts/bump-version.sh $LAST_RELEASE ${{ github.event.inputs.version }}
39+
- name: Update changelog
40+
if: ${{ github.event.inputs.type == 'release' }}
41+
uses: orhun/git-cliff-action@v4
42+
with:
43+
args: --unreleased --prepend CHANGELOG.md --tag ${{ github.event.inputs.version }} --github-token ${{ secrets.GITHUB_TOKEN }}
44+
- name: Commit release prep changes
45+
run: |
46+
git add CHANGELOG.md
47+
cat .github/scripts/files-with-current-version-string | xargs -I % git add %
48+
git commit -m "chore(release): prepare ${{ github.event.inputs.version }}"
49+
- name: Push branch
50+
run: git push origin HEAD
51+
# waiting on org level permissions for this step
52+
# - name: Create Pull Request
53+
# run: gh pr create --base main --head release/${{ github.event.inputs.version }} --title "Release | ${{ github.event.inputs.version }}" --body "Prepare release of version ${{ github.event.inputs.version }}."
54+
# env:
55+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
repos:
2-
- repo: https://github.com/doublify/pre-commit-rust
3-
rev: v1.0
2+
- repo: https://github.com/AndrejOrsula/pre-commit-cargo.git
3+
rev: 0.4.0
44
hooks:
5-
- id: fmt
5+
- id: cargo-fmt
66
stages: [pre-commit]
77
- repo: https://github.com/compilerla/conventional-pre-commit
8-
rev: v3.2.0
8+
rev: v4.0.0
99
hooks:
1010
- id: conventional-pre-commit
1111
stages: [commit-msg]
1212
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: v4.4.0
13+
rev: v5.0.0
1414
hooks:
1515
- id: check-added-large-files
1616
stages: [pre-commit]
@@ -27,7 +27,13 @@ repos:
2727
- id: mixed-line-ending
2828
stages: [pre-commit]
2929
- repo: https://github.com/codespell-project/codespell
30-
rev: v2.2.4
30+
rev: v2.4.1
3131
hooks:
3232
- id: codespell
33-
args: [-I, codespell-ignore]
33+
args: [-I, codespell-ignore, -w]
34+
ci:
35+
autofix_commit_msg: |
36+
ci: [pre-commit.ci] auto fixes from pre-commit.com hooks
37+
38+
for more information, see https://pre-commit.ci
39+
autoupdate_commit_msg: 'ci: [pre-commit.ci] pre-commit autoupdate'

0 commit comments

Comments
 (0)