Skip to content

Commit

Permalink
Update CI to Handle No dev Branch (#9)
Browse files Browse the repository at this point in the history
* Update CI to handle eliminated dev branch.

* Bump version number

* remove replaced code

* Update Changelog to make parser happy

* fix versioning code
  • Loading branch information
esarver authored Apr 1, 2024
1 parent dcf64e9 commit 4bceee4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
- sbom
- lint
- style
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
Expand All @@ -156,11 +156,29 @@ jobs:
id: lasttag
run: |
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="$(npm pkg get version)"
echo "Extracted Version: $V"
V="$(echo v"$V" | sed 's/\"//g')"
echo "Cleaned up Version: $V"
fi
# 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
if ${{! github.event.pull_request.merged}}; then
# 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)"
echo "RC Version: $V"
fi
CL=${V#v}
Expand All @@ -169,6 +187,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
Expand Down Expand Up @@ -203,7 +222,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}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/veracode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Veracode Scan
on:
push:
branches:
- dev
- main
schedule:
- cron: 0 0 * * sun
workflow_dispatch:
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
Security -- in case of vulnerabilities.
-->

## [0.15.1]

### Changed
- Nothing yet

## [0.15.0]

### Fixed
Expand Down Expand Up @@ -69,7 +74,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
- Feature to retrieve TSP-Link network details

<!--Version Comparison Links-->
[Unreleased]: https://github.com/tektronix/tsp-toolkit/compare/v0.15.0...HEAD
[Unreleased]: https://github.com/tektronix/tsp-toolkit/compare/v0.15.1...HEAD
[0.15.1]: https://github.com/tektronix/tsp-toolkit/releases/tag/v0.15.1
[0.15.0]: https://github.com/tektronix/tsp-toolkit/releases/tag/v0.15.0
[0.14.1]: https://github.com/tektronix/tsp-toolkit/releases/tag/v0.14.1
[0.13.2]: https://github.com/tektronix/tsp-toolkit/releases/tag/v0.13.2
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "Tektronix",
"displayName": "[Beta] Keithley TSP Toolkit",
"description": "VSCode extension for Keithley Instruments' Test Script Protocol",
"version": "0.15.0",
"version": "0.15.1",
"icon": "./resources/TSP_Toolkit_128x128.png",
"galleryBanner": {
"color": "#EEEEEE",
Expand Down

0 comments on commit 4bceee4

Please sign in to comment.