updated publish bin path #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PUBLISH BETA | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- 'development' | |
- 'dev/**' | |
- 'fix/**' | |
- 'bug/**' | |
- 'hotfix/**' | |
- 'feat/**' | |
- 'feature/**' | |
jobs: | |
build: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
outputs: | |
Version: ${{ steps.gitversion.outputs.SemVer }} | |
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 #fetch-depth is needed for GitVersion | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: 5.x | |
- name: Determine Version | |
uses: gittools/actions/gitversion/[email protected] | |
id: gitversion | |
- name: Display GitVersion outputs | |
run: | | |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}" | |
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Dotnet Restore | |
run: dotnet restore ./**.sln | |
- name: Build Source Projects | |
run: dotnet build ./**.sln -p:Version='${{ steps.gitversion.outputs.SemVer }}' -c Release | |
- name: Pack NuGet Packages | |
run: dotnet pack ./**.sln -p:Version='${{ steps.gitversion.outputs.SemVer }}' -c Release -o bin/nugetPackages | |
- name: Find CLZ Output | |
id: find_clz | |
run: | | |
CLZ_FILE=$(find ./source/ -name "*.clz" | head -n 1) | |
echo "CLZ_PATH=${CLZ_FILE}" >> $GITHUB_OUTPUT | |
echo $CLZ_PATH | |
echo done | |
- name: Copy CLZ if Found | |
run: | | |
if [ -f ${{ steps.find_clz.outputs.CLZ_PATH }} ]; then | |
cp ${{ steps.find_clz.outputs.CLZ_PATH }} bin/nugetPackages | |
else | |
echo "Could not find CLZ." | |
fi | |
- name: Copy USH Files | |
run: | | |
if [ -f './source/WebLogger.Crestron/Simpl/WebLogger Command.ush' ]; then | |
cp './source/WebLogger.Crestron/Simpl/WebLogger Command.ush' bin/nugetPackages | |
else | |
echo "Could not find Command.ush" | |
fi | |
if [ -f './source/WebLogger.Crestron/Simpl/WebLogger Server.ush' ]; then | |
cp './source/WebLogger.Crestron/Simpl/WebLogger Server.ush' bin/nugetPackages | |
else | |
echo "Could not find Command.ush" | |
fi | |
- name: Upload NuGet package to GitHub | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nugetPackage | |
path: bin/nugetPackages | |
release: | |
if: needs.build.outputs.CommitsSinceVersionSource > 0 | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download nuget package artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: nugetPackage | |
path: bin/nugetPackages | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
tag: ${{ needs.build.outputs.Version }} | |
name: Release ${{ needs.build.outputs.Version }} | |
body: Released via github actions workflow, see repository README.md | |
generateReleaseNotes: true | |
artifacts: "bin/nugetPackages/" | |
prerelease: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push packages to Nuget | |
run: | | |
for file in $(find bin/nugetPackages -type f -name "*.nupkg"); do | |
echo $file | |
dotnet nuget push $file --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate | |
done | |