From 37e224766e77464f4fc8938970c1340435a6e31e Mon Sep 17 00:00:00 2001 From: "jm.fiaschi" Date: Fri, 17 Dec 2021 22:06:45 +0100 Subject: [PATCH] fix(cicd): update version automatically --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++----- .github/workflows/lint.yml | 15 ------------- .github/workflows/release.yml | 28 ------------------------ .releaserc.json | 12 +++++++++- Cargo.toml | 2 +- README.md | 2 +- 6 files changed, 48 insertions(+), 52 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..e0d6598 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 }} \ No newline at end of file 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/.releaserc.json b/.releaserc.json index f5aef5d..33f967f 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -16,6 +16,15 @@ "plugins": [ "@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", { @@ -24,6 +33,7 @@ ], "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" } - ] + ], + "@semantic-release/github" ] } \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 56662b2..a443e35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "json_value_resolve" -version = "0.2.0" +version ="1.0.4-beta.5" authors = ["Jean-Marc Fiaschi "] edition = "2018" description = "Interface to resolve String to serde_json::Value." diff --git a/README.md b/README.md index 9135cf2..ce862c0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Give an interface to resolve scalar to json_serde::Value. ```Toml [dependencies] -json_value_resolve = "0.2" +json_value_resolve = "1.0" ``` ## Usage