diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c797d14 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Release + +on: + push: + branches: + - main + workflow_run: + workflows: + - Rust + types: + - completed + +permissions: + contents: write + pull-requests: write + +concurrency: + group: release-plz + cancel-in-progress: false + +jobs: + release-pr: + name: Create or update release PR + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: release-plz/action@v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish: + name: Publish release + if: >- + github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success' && + startsWith(github.event.workflow_run.head_commit.message, 'chore: release v') + runs-on: ubuntu-latest + environment: crates-io + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.workflow_run.head_sha }} + - uses: release-plz/action@v0.5 + with: + command: release + token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 0000000..3f308d4 --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,6 @@ +[workspace] +git_tag_name = "v{{ version }}" +git_release_name = "v{{ version }}" +publish_all_features = true +release_always = false +release_commits = "^(feat|fix)(\\([^)]*\\))?!?:" diff --git a/tests/priority_queue_deckey_tests/change_key_or_push.rs b/tests/priority_queue_deckey_tests/change_key_or_push.rs index 339907c..e0af416 100644 --- a/tests/priority_queue_deckey_tests/change_key_or_push.rs +++ b/tests/priority_queue_deckey_tests/change_key_or_push.rs @@ -9,7 +9,7 @@ where P: PriorityQueueDecKey, { fn push_at_first_pass(i: usize) -> bool { - i % 3 != 0 + !i.is_multiple_of(3) } pq.clear();