Revert "fix: updated build script"

This reverts commit deb14c63e5.
This commit is contained in:
Nick Genovese
2024-12-06 13:04:19 -05:00
parent 0982edfd83
commit 7cb5b0a0a6
3 changed files with 172 additions and 42 deletions

View File

@@ -24,50 +24,29 @@ jobs:
env:
GITHUB_REF: ${{ github.ref }}
- name: Set Version Number and Phase
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
run: "npm install -g
semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator
@semantic-release/changelog @semantic-release/exec conventional-changelog-conventionalcommits"
- name: Run semantic-release
id: get_version
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Print summary if no new version
if: steps.get_version.outputs.newVersion != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN}}
run: |
# Set initial version
latestVersion="2.0.0"
newVersion="$latestVersion"
phase=""
newVersionString=""
# Output current GitHub Ref
echo "Current GitHub Ref: $GITHUB_REF"
# Determine the phase and version string based on the branch
case $GITHUB_REF in
refs/pull/*)
phase="beta"
newVersionString="${newVersion}-${phase}-${GITHUB_RUN_NUMBER}"
;;
refs/heads/hotfix-2.0.0/*)
phase="hotfix"
newVersionString="${newVersion}-${phase}-${GITHUB_RUN_NUMBER}"
;;
refs/heads/release-2.0.0/*)
splitRef=(${GITHUB_REF//\// })
version="${splitRef[-1]//v/}"
phase="rc"
newVersionString="${version}-${phase}-${GITHUB_RUN_NUMBER}"
;;
refs/heads/feature-2.0.0/*)
phase="alpha"
newVersionString="${newVersion}-${phase}-${GITHUB_RUN_NUMBER}"
;;
development-2.0.0)
phase="beta"
newVersionString="${newVersion}-${phase}-${GITHUB_RUN_NUMBER}"
;;
esac
# Output the final determined version and build phase
echo "Version to be used: $newVersionString"
echo "Build Phase: $phase"
# Write the version to the GitHub environment file
echo "version=$newVersionString" >> $GITHUB_ENV
echo "# Summary" >> $GITHUB_STEP_SUMMARY
echo "No new version generated" >> $GITHUB_STEP_SUMMARY
- name: Set up .NET
uses: actions/setup-dotnet@v3