Skip to content

Commit

Permalink
Fixes up release to attach ZIP artifacts, and genericizes actions to …
Browse files Browse the repository at this point in the history
…be converted for other projects
  • Loading branch information
i8beef committed Aug 4, 2021
1 parent 777cd7b commit fd5bee7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
DOTNETVERSION: "5.0.x"
APP: "I8Beef.Ecobee"
SOLUTION: "./src/I8Beef.Ecobee.sln"
BUILDOUTPUTPATH: "./src/I8Beef.Ecobee/bin/Release/netstandard2.0"

jobs:
build:
Expand All @@ -34,7 +35,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: ${{ env.APP }}
path: src/I8Beef.Ecobee/bin/Release/netstandard2.0
path: ${{ env.BUILDOUTPUTPATH }}

- name: Test
run: dotnet test ${{ env.SOLUTION }} --no-restore --verbosity normal --logger trx --results-directory "TestResults"
Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ env:
DOTNETVERSION: "5.0.x"
APP: "I8Beef.Ecobee"
SOLUTION: "./src/I8Beef.Ecobee.sln"
BUILDOUTPUTPATH: "./src/I8Beef.Ecobee/bin/Release/netstandard2.0"
PACKOUTPUTPATH: "./out"

jobs:
build:
Expand Down Expand Up @@ -44,8 +46,8 @@ jobs:
- name: Upload app build artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.APP }}
path: src/I8Beef.Ecobee/bin/Release/netstandard2.0
name: ${{ env.APP }}-${{ steps.version.outputs.version-without-v }}
path: ${{ env.BUILDOUTPUTPATH }}

- name: Upload TestResults build artifact
uses: actions/upload-artifact@v2
Expand All @@ -71,15 +73,29 @@ jobs:
body: ${{ env.LOG }}
draft: false
prerelease: false


- name: ZIP release artifact
run: zip -r ${{ env.APP }}-${{ steps.version.outputs.version-without-v }}.zip ${{ env.BUILDOUTPUTPATH }}

- name: GitHub release assets
uses: actions/upload-release-asset@v1
id: release_assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ${{ env.APP }}-${{ steps.version.outputs.version-without-v }}.zip
asset_name: ${{ env.APP }}-${{ steps.version.outputs.version-without-v }}.zip
asset_content_type: application/zip

- name: NuGet pack
run: dotnet pack ${{ env.SOLUTION }} --configuration Release --no-restore --include-symbols /p:Version=${{ steps.version.outputs.version-without-v }} -o out
run: dotnet pack ${{ env.SOLUTION }} --configuration Release --no-restore --include-symbols /p:Version=${{ steps.version.outputs.version-without-v }} -o ${{ env.PACKOUTPUTPATH }}

- name: Upload NuGet build artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.APP }} NuGet Packages
path: out
path: ${{ env.PACKOUTPUTPATH }}

- name: NuGet push
run: dotnet nuget push "./out/*.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}
run: dotnet nuget push "./${{ env.PACKOUTPUTPATH }}/*.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}

0 comments on commit fd5bee7

Please sign in to comment.