From e9cfe33c7194aa7efe6881b1f35175e0709e673c Mon Sep 17 00:00:00 2001 From: "Sarver, Edwin" Date: Thu, 28 Mar 2024 12:58:40 -0400 Subject: [PATCH 1/6] Changes to Eliminate `dev` Branch --- .github/workflows/pr.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index abae3cd..dc58614 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -220,15 +220,31 @@ jobs: if: ${{ endsWith(github.base_ref, 'main') && contains(github.head_ref, 'release') }} run: | git config --global --add safe.directory "$PWD" + apt-get install -yqq jq COMMIT="${{github.sha}}" - V="${{github.head_ref}}" - V="${V#release/v}" + if ${{contains(github.head_ref, 'release')}}; then + V="${{github.head_ref}}" + V="${V#release/}" + else + V="$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version')" + V=v${V//\"/} #remove '"'s + fi - if ${{! github.event.pull_request.merged}}; then - V="${V}-$(git tag --list v${V}* | wc -l)" + # Check to see if the version tag already exists + # If it does, print a message and exit with an error code + if [ $(git tag --list "$V") ]; then + echo "Version tag already exists. Did you bump the version number?" + exit 1 fi - CL=${V} + # Create an RC release if + # 1) This PR is a release branch that hasn't been merged to main. + # 2) This is a feature branch being merged into the main branch. + if ${{(! github.event.pull_request.merged && contains(github.head_ref, 'release')) || (github.event.pull_request.merged && !contains(github.head_ref, 'release'))}}; then + V="${V}-$(git tag --list ${V}* | wc -l)" + fi + + CL=${V#v} CL=${CL%-*} echo "version=${V}" >> $GITHUB_OUTPUT From 6f5033dc6a497c82798c398be79f7894d579adfb Mon Sep 17 00:00:00 2001 From: "Sarver, Edwin" Date: Thu, 28 Mar 2024 12:58:55 -0400 Subject: [PATCH 2/6] Bump manifest versions --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b327d93..640e396 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1130,7 +1130,7 @@ dependencies = [ [[package]] name = "instrument-repl" -version = "0.15.0" +version = "0.15.1" dependencies = [ "chrono", "clap", @@ -1250,7 +1250,7 @@ dependencies = [ [[package]] name = "kic" -version = "0.15.0" +version = "0.15.1" dependencies = [ "anyhow", "clap", @@ -1269,7 +1269,7 @@ dependencies = [ [[package]] name = "kic-discover" -version = "0.15.0" +version = "0.15.1" dependencies = [ "anyhow", "async-std", diff --git a/Cargo.toml b/Cargo.toml index 5f4047f..7a40a1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.15.0" +version = "0.15.1" authors = ["Keithley Instruments, LLC"] edition = "2021" repository = "https://github.com/tektronix/tsp-toolkit-kic-cli" diff --git a/package-lock.json b/package-lock.json index 16b9c83..96332df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tektronix/kic-cli", - "version": "0.15.0", + "version": "0.15.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tektronix/kic-cli", - "version": "0.15.0", + "version": "0.15.1", "bin": { "linux-kic": "bin/kic", "linux-kic-discover": "bin/kic-discover", diff --git a/package.json b/package.json index 29f2d9d..cd3036f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tektronix/kic-cli", - "version": "0.15.0", + "version": "0.15.1", "main": "index.js", "bin": { "windows-kic": "./bin/kic.exe", From fac1a6dcba0a6155f8b37cd86153c7c288dcd250 Mon Sep 17 00:00:00 2001 From: "Sarver, Edwin" Date: Thu, 28 Mar 2024 13:40:52 -0400 Subject: [PATCH 3/6] Improve conditionals --- .github/workflows/pr.yml | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dc58614..5d577a6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -217,7 +217,7 @@ jobs: path: target/ - name: Get Tagged Version id: lasttag - if: ${{ endsWith(github.base_ref, 'main') && contains(github.head_ref, 'release') }} + if: ${{ endsWith(github.base_ref, 'main') && (contains(github.head_ref, 'release/') || github.event.pull_request.merged) }} run: | git config --global --add safe.directory "$PWD" apt-get install -yqq jq @@ -240,7 +240,7 @@ jobs: # Create an RC release if # 1) This PR is a release branch that hasn't been merged to main. # 2) This is a feature branch being merged into the main branch. - if ${{(! github.event.pull_request.merged && contains(github.head_ref, 'release')) || (github.event.pull_request.merged && !contains(github.head_ref, 'release'))}}; then + if ${{(! github.event.pull_request.merged && contains(github.head_ref, 'release/')) || (github.event.pull_request.merged && !contains(github.head_ref, 'release/'))}}; then V="${V}-$(git tag --list ${V}* | wc -l)" fi @@ -268,7 +268,7 @@ jobs: publish: name: Publish - if: ${{ endsWith(github.base_ref, 'main') && contains(github.head_ref, 'release') }} + if: ${{ endsWith(github.base_ref, 'main') && (contains(github.head_ref, 'release/') || github.event.pull_request.merged) }} needs: - build - lint @@ -320,7 +320,7 @@ jobs: - code_coverage - package - sbom - if: ${{ endsWith(github.base_ref, 'main') && contains(github.head_ref, 'release') }} + if: ${{ endsWith(github.base_ref, 'main') && (contains(github.head_ref, 'release/') || github.event.pull_request.merged) }} steps: - name: Checkout uses: actions/checkout@v3 @@ -330,11 +330,28 @@ jobs: - name: Get Tagged Version id: lasttag run: | + git config --global --add safe.directory "$PWD" + apt-get install -yqq jq COMMIT="${{github.sha}}" - V="${{github.head_ref}}" - V="${V#release/}" + if ${{contains(github.head_ref, 'release/')}}; then + V="${{github.head_ref}}" + V="${V#release/}" + else + V="$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version')" + V=v${V//\"/} #remove '"'s + fi - if ${{! github.event.pull_request.merged}}; then + # Check to see if the version tag already exists + # If it does, print a message and exit with an error code + if [ $(git tag --list "$V") ]; then + echo "Version tag already exists. Did you bump the version number?" + exit 1 + fi + + # Create an RC release if + # 1) This PR is a release branch that hasn't been merged to main. + # 2) This is a feature branch being merged into the main branch. + if ${{(! github.event.pull_request.merged && contains(github.head_ref, 'release/')) || (github.event.pull_request.merged && !contains(github.head_ref, 'release/'))}}; then V="${V}-$(git tag --list ${V}* | wc -l)" fi @@ -344,6 +361,7 @@ jobs: echo "version=${V}" >> $GITHUB_OUTPUT echo "cl_version=${CL}" >> $GITHUB_OUTPUT echo "commit=${COMMIT}" >> $GITHUB_OUTPUT + - run: 'git tag --list ${V}*' - name: Get Artifacts uses: actions/download-artifact@v3 @@ -378,7 +396,7 @@ jobs: ${{steps.changelog.outputs.description}} - prerelease: ${{! github.event.pull_request.merged}} + prerelease: ${{(! github.event.pull_request.merged) || (github.event.pull_request.merged && ! contains(github.head_ref, 'release/'))}} commit: ${{steps.lasttag.outputs.commit}} makeLatest: true tag: ${{steps.lasttag.outputs.version}} From 132eebcfa145c63962894ac323cd5f05c0954916 Mon Sep 17 00:00:00 2001 From: "Sarver, Edwin" Date: Thu, 28 Mar 2024 14:32:01 -0400 Subject: [PATCH 4/6] Bump Changelog version --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4d1463..68aae61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how Fixed -- for any bug fixes. Security -- in case of vulnerabilities. --> +## [0.15.1] + ## [0.15.0] ### Fixed @@ -74,7 +76,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how - Feature to retrieve TSP-Link network details -[Unreleased]: https://github.com/tektronix/tsp-toolkit-kic-cli/compare/v0.15.0...HEAD +[Unreleased]: https://github.com/tektronix/tsp-toolkit-kic-cli/compare/v0.15.1...HEAD +[0.15.1]: https://github.com/tektronix/tsp-toolkit-kic-cli/releases/tag/v0.15.1 [0.15.0]: https://github.com/tektronix/tsp-toolkit-kic-cli/releases/tag/v0.15.0 [0.14.1]: https://github.com/tektronix/tsp-toolkit-kic-cli/releases/tag/v0.14.1 [0.13.2]: https://github.com/tektronix/tsp-toolkit-kic-cli/releases/tag/v0.13.2 From dd8666dc00ffe6af7f78969f2f953ba19e23f7ff Mon Sep 17 00:00:00 2001 From: "Sarver, Edwin" Date: Fri, 29 Mar 2024 09:29:32 -0400 Subject: [PATCH 5/6] Add \pt-get update\ call --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5d577a6..75d63c5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -220,7 +220,7 @@ jobs: if: ${{ endsWith(github.base_ref, 'main') && (contains(github.head_ref, 'release/') || github.event.pull_request.merged) }} run: | git config --global --add safe.directory "$PWD" - apt-get install -yqq jq + apt-get update && apt-get install -yqq jq COMMIT="${{github.sha}}" if ${{contains(github.head_ref, 'release')}}; then V="${{github.head_ref}}" From 4004be28cdc693d8549dc2d0c6bda2ac0dccf78f Mon Sep 17 00:00:00 2001 From: "Sarver, Edwin" Date: Fri, 29 Mar 2024 09:43:23 -0400 Subject: [PATCH 6/6] Add entry to changelog to make changelog parser happy --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68aae61..5d97f61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how --> ## [0.15.1] +### Changed +- No changes yet + ## [0.15.0] ### Fixed