From a4ce293885fd38cb66a6f50c09322fd2657b11f0 Mon Sep 17 00:00:00 2001 From: jmfiaschi Date: Fri, 17 Dec 2021 22:57:32 +0100 Subject: [PATCH] fix(cargo): update version automatically --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++----- .github/workflows/lint.yml | 15 ------------ .github/workflows/release.yml | 28 --------------------- .gitignore | 1 - .releaserc.json | 46 ++++++++++++++++++++--------------- README.md | 1 - 6 files changed, 62 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d2e622..bff5cf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,21 @@ -name: CI +--- +name: ci -on: [push] +on: push env: CARGO_TERM_COLOR: always jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: rustup component add clippy + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features build: runs-on: ubuntu-latest steps: @@ -18,7 +28,7 @@ jobs: - run: cargo clean - run: cargo build unit-tests: - needs: [build] + needs: [build,lint] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -30,7 +40,7 @@ jobs: - run: cargo test --doc -- --test-threads=1 - run: cargo test --lib -- --test-threads=1 integration-tests: - needs: [build] + needs: [build,lint] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -41,13 +51,14 @@ jobs: - uses: Swatinem/rust-cache@v1 - run: cargo test --tests -- --test-threads=1 benchmark: - needs: ["build"] + needs: [build,lint] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: nelonoel/branch-name@v1.0.1 - uses: actions-rs/toolchain@v1 with: + toolchain: stable override: true - uses: Swatinem/rust-cache@v1 @@ -61,8 +72,26 @@ jobs: output-file-path: output.txt github-token: ${{ secrets.GITHUB_TOKEN }} auto-push: true - alert-threshold: '130%' + alert-threshold: '200%' comment-on-alert: true fail-on-alert: true alert-comment-cc-users: '@jmfiaschi' benchmark-data-dir-path: 'docs/bench/${{ env.BRANCH_NAME }}' + release: + needs: [benchmark,integration-tests,unit-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Semantic Release + run: | + sudo npm install semantic-release -g + sudo npm install @semantic-release/changelog -g + sudo npm install @semantic-release/git -g + sudo npm install @semantic-release/github -g + sudo npm install @semantic-release/exec -g + cargo install semantic-release-rust --version 1.0.0-alpha.8 + - name: Run Semantic Release + run: semantic-release + env: + GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 8f10401..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Lint - -on: push - -jobs: - linters: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - run: rustup component add clippy - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 483f302..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Release -on: - push: - branches: - - main -jobs: - release: - name: Release - runs-on: ubuntu-18.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install Semantic Release - run: | - sudo npm install semantic-release -g - sudo npm install @semantic-release/changelog -g - sudo npm install @semantic-release/git -g - sudo npm install @semantic-release/github -g - sudo npm install @semantic-release/exec -g - cargo install semantic-release-rust --version 1.0.0-alpha.8 - - - name: Run Semantic Release - run: semantic-release - - env: - GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.gitignore b/.gitignore index 671ef89..088ba6b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,3 @@ Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk - diff --git a/.releaserc.json b/.releaserc.json index 9f030d0..ce1d840 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,31 +1,39 @@ { "branches": [ "+([0-9])?(.{+([0-9]),x}).x", - "main", + "main", "next", - "next-major", + "next-major", { - "name": "beta", + "name": "beta", "prerelease": true - }, + }, { - "name": "alpha", + "name": "alpha", "prerelease": true } ], "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/changelog", + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + [ + "@semantic-release/exec", + { + "verifyConditionsCmd": "semantic-release-rust verify-conditions", + "prepareCmd": "semantic-release-rust prepare ${nextRelease.version}", + "publishCmd": "semantic-release-rust publish" + } + ], + [ "@semantic-release/git", - "@semantic-release/github", - [ - "@semantic-release/exec", - { - "verifyConditionsCmd": "semantic-release-rust verify-conditions", - "prepareCmd": "semantic-release-rust prepare ${nextRelease.version}", - "publishCmd": "semantic-release-rust publish" - } - ] - ] -} \ No newline at end of file + { + "assets": [ + "Cargo.toml" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + "@semantic-release/github" + ] +} diff --git a/README.md b/README.md index 6cf5093..2da1363 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # json_value_merge -[![Linter](https://github.com/jmfiaschi/json_value_merge/workflows/Lint/badge.svg)](https://github.com/jmfiaschi/json_value_merge/actions/workflows/lint.yml) [![Actions Status](https://github.com/jmfiaschi/json_value_merge/workflows/CI/badge.svg)](https://github.com/jmfiaschi/json_value_merge/actions/workflows/ci.yml) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)