mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-27 11:24:55 +00:00
Revert "feat: messing with a new version action"
This reverts commit c37a9eab53.
This commit is contained in:
53
.github/workflows/build.yml
vendored
53
.github/workflows/build.yml
vendored
@@ -24,9 +24,50 @@ jobs:
|
||||
env:
|
||||
GITHUB_REF: ${{ github.ref }}
|
||||
|
||||
- name: Git Version
|
||||
- name: Set Version Number and Phase
|
||||
id: get_version
|
||||
uses: codacy/git-version@2.7.1
|
||||
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
|
||||
|
||||
- name: Set up .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
@@ -46,15 +87,21 @@ jobs:
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
if: steps.get_version.outputs.newVersion == 'true'
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
prerelease: ${{ steps.get_branch.outcome.branch != 'main' }}
|
||||
artifacts: "output/**/*.*(cpz|cplz)"
|
||||
tag: ${{ steps.get_version.outputs.version }}
|
||||
tag: ${{ steps.get_version.outputs.tag }}
|
||||
commit: ${{ github.sha }}
|
||||
bodyFile: ./CHANGELOG.md
|
||||
|
||||
- name: Print results
|
||||
if: steps.get_version.outputs.newVersion == 'true'
|
||||
run: |
|
||||
echo "# Summary" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Version: ${{ steps.get_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Tag: ${{ steps.get_version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "New Version: ${{ steps.get_version.outputs.newVersion }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Channel: ${{ steps.get_version.outputs.channel }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Type: ${{ steps.get_version.outputs.type }}" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
Reference in New Issue
Block a user