Skip to content

Commit

Permalink
actions++
Browse files Browse the repository at this point in the history
  • Loading branch information
vpenades committed May 11, 2024
1 parent 7fa65f8 commit f5ad624
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/BuildPackages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on:

workflow_dispatch:
inputs:
package-version:
nuget-semver:
type: string
description: 'package version'
required: false
default: '1.0.0-Test-DATE-TIME'

workflow_call:
inputs:
package-version:
nuget-semver:
type: string
description: 'package version'
required: true
Expand Down Expand Up @@ -40,23 +40,23 @@ jobs:

- name: Define SemVer suffix
run: |
PACKAGEVERSION="${{ inputs.package-version }}"
NUGETSEMVER="${{ inputs.nuget-semver }}"
# replace DATE
DATE_SHORT=$(date +'%Y%m%d')
if [[ "PACKAGEVERSION" == *"$DATE"* ]]; then
PACKAGEVERSION="${PACKAGEVERSION/DATE/$DATE_SHORT}"
if [[ "NUGETSEMVER" == *"$DATE"* ]]; then
NUGETSEMVER="${NUGETSEMVER/DATE/$DATE_SHORT}"
fi
# replace TIME
TIME_SHORT=$(date +'%H%M%S')
if [[ "PACKAGEVERSION" == *"$TIME"* ]]; then
PACKAGEVERSION="${PACKAGEVERSION/TIME/$TIME_SHORT}"
if [[ "NUGETSEMVER" == *"$TIME"* ]]; then
NUGETSEMVER="${NUGETSEMVER/TIME/$TIME_SHORT}"
fi
# emit env variable
echo "PACKAGEVERSION=PACKAGEVERSION" >> $GITHUB_ENV
echo ${{ env.PACKAGEVERSION }}
echo "NUGETSEMVER=NUGETSEMVER" >> $GITHUB_ENV
echo ${{ env.NUGETSEMVER }}
# --------------------------------------------- build

Expand All @@ -67,7 +67,7 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build -c Release /p:Version=1.0.0-${{ env.PACKAGEVERSION }}
run: dotnet build -c Release /p:Version=1.0.0-${{ env.NUGETSEMVER }}

- name: Pack
run: dotnet pack -c Release --no-build --output "."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/PublishToGithub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build_job:
uses: ./.github/workflows/BuildPackages.yml
with:
package-version: 1.0.0-Preview-DATE
nuget-semver: 1.0.0-Preview-DATE

publish_job:
needs: build_job
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/PublishToNuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build_job:
uses: ./.github/workflows/BuildPackages.yml
with:
package-version: 1.0.0-alpha${{ vars.SharpGLTF_AlphaVersion }}
nuget-semver: 1.0.0-alpha${{ vars.SharpGLTF_AlphaVersion }}

publish_job:
needs: build_job
Expand Down

0 comments on commit f5ad624

Please sign in to comment.