From b13359571b96888ced921acf1cc67ee4aef24d4f Mon Sep 17 00:00:00 2001 From: "ben.leadbetter" Date: Sat, 8 Feb 2025 16:57:51 +0100 Subject: [PATCH] feat: adds finish release action --- .../scripts/files-with-current-version-string | 1 - .github/workflows/finish-release.yml | 45 +++++++++++++++++++ .../{gitflow.yml => start-release.yml} | 7 +-- README.md | 2 +- midi2/Cargo.toml | 4 +- midi2_proc/Cargo.toml | 2 +- 6 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/finish-release.yml rename .github/workflows/{gitflow.yml => start-release.yml} (92%) diff --git a/.github/scripts/files-with-current-version-string b/.github/scripts/files-with-current-version-string index 896708e..b310541 100644 --- a/.github/scripts/files-with-current-version-string +++ b/.github/scripts/files-with-current-version-string @@ -1,4 +1,3 @@ README.md midi2/Cargo.toml midi2_proc/Cargo.toml - diff --git a/.github/workflows/finish-release.yml b/.github/workflows/finish-release.yml new file mode 100644 index 0000000..c5c8966 --- /dev/null +++ b/.github/workflows/finish-release.yml @@ -0,0 +1,45 @@ +name: Finish release + +on: + workflow_dispatch: + inputs: + version: + description: Semver version to release + required: true + type: + description: What type of release + required: true + default: 'release' + type: choice + options: + - release + - hotfix + +jobs: + release-finish: + name: Finish release + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.type }}/${{ github.event.inputs.version }} + - name: Check semver + uses: obi1kenobi/cargo-semver-checks-action@v2 + with: + verbose: true + - name: Setup git-flow + run: ./.github/scripts/setup-git-flow.sh + - name: Finish release + run: git flow ${{ github.event.inputs.type }} finish ${{ github.event.inputs.version }} -m ${{ github.event.inputs.version }} --push + - name: Publish midi2_proc + uses: ryohidaka/action-cargo-publish@v0.1.0 + with: + path: midi2_proc + token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + - name: Publish midi2 + uses: ryohidaka/action-cargo-publish@v0.1.0 + with: + path: midi2 + token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/gitflow.yml b/.github/workflows/start-release.yml similarity index 92% rename from .github/workflows/gitflow.yml rename to .github/workflows/start-release.yml index 470408f..0e8e6cb 100644 --- a/.github/workflows/gitflow.yml +++ b/.github/workflows/start-release.yml @@ -9,7 +9,8 @@ on: type: description: What type of release required: true - default: release + default: 'release' + type: choice options: - release - hotfix @@ -23,16 +24,12 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - fetch-tags: true - ref: ${{ github.ref }} - name: Setup git-flow run: ./.github/scripts/setup-git-flow.sh - name: Start release run: git flow ${{ github.event.inputs.type }} start ${{ github.event.inputs.version }} - name: Determine last release run: echo "LAST_RELEASE=$(./.github/scripts/last-released-version.sh)" >> $GITHUB_ENV - - name: Debug - run: cat ./.github/scripts/bump-version.sh - name: Bump version run: ./.github/scripts/bump-version.sh $LAST_RELEASE ${{ github.event.inputs.version }} - name: Update changelog diff --git a/README.md b/README.md index b71b757..d5370d7 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ You'll want to setup midi2 without default features to compile without the `std` feature. ```toml -midi2 = { version = "0.8.0", default-features = false, features = ["channel-voice2", "sysex7"], } +midi2 = { version = "0.7.0", default-features = false, features = ["channel-voice2", "sysex7"], } ``` ### Generic Representation diff --git a/midi2/Cargo.toml b/midi2/Cargo.toml index 765d870..482c2a0 100644 --- a/midi2/Cargo.toml +++ b/midi2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "midi2" -version = "0.8.0" +version = "0.7.0" description = "Ergonomic, versatile, strong types wrapping MIDI 2.0 message data." edition = "2021" readme = "README.md" @@ -13,7 +13,7 @@ repository = "https://github.com/midi2-dev/bl-midi2-rs.git" [dependencies] derive_more = { version = "2.0.1", features = ["from"], default-features = false } fixed = "1.28.0" -midi2_proc = { version = "0.8.0", path = "../midi2_proc" } +midi2_proc = { version = "0.7.0", path = "../midi2_proc" } ux = "0.1.6" [dev-dependencies] diff --git a/midi2_proc/Cargo.toml b/midi2_proc/Cargo.toml index eaee345..b86ac99 100644 --- a/midi2_proc/Cargo.toml +++ b/midi2_proc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "midi2_proc" description = "Internal procedural macro crate. Only intended for use with midi2" -version = "0.8.0" +version = "0.7.0" edition = "2021" readme = "README.md" license = "MIT OR Apache-2.0"