Skip to content

Commit

Permalink
build and release as separate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubramanianaks committed Aug 12, 2022
1 parent ea8f5d9 commit 0b9b16c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ jobs:
# asset_path: ${{ github.workspace }}/src/dsc/bin/Release/netcoreapp3.1/win-x64/publish/lpk-win.zip
# asset_name: lpk-win.zip
# asset_content_type: application/zip
# - name: Upload Release
# uses: actions/upload-artifact@v3
# with:
# name: lpk-win-artifact
# path: ${{ github.workspace }}/src/dsc/bin/Release/netcoreapp3.1/win-x64/publish/lpk-win.zip
- name: Upload Release
uses: actions/upload-artifact@v3
with:
name: lpk-win-artifact
path: ${{ github.workspace }}/src/dsc/bin/Release/netcoreapp3.1/win-x64/publish/lpk-win.zip
linux-binaries:
runs-on: windows-latest
steps:
Expand Down
29 changes: 24 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ "main" ]

jobs:
build_and_release:
build:
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -22,7 +22,7 @@ jobs:
uses: NuGet/setup-nuget@v1.0.6
- name: Restore dependencies using Nuget
run: nuget restore src/client.sln -Verbosity Normal -NonInteractive -ConfigFile src/nuget.config
- name: dotnet Publish for {{ matrix.mode }}
- name: dotnet Publish for ${{ matrix.mode }}
run: dotnet publish src/dsc/dsc.csproj -c Release -r ${{ matrix.mode }} --no-restore --self-contained true --verbosity normal
- name: Build endpointmanagerlauncher
run: dotnet publish src\EndpointManagerLauncher\endpointmanagerlauncher.csproj -r win-x64 -c Release --no-restore
Expand All @@ -32,14 +32,26 @@ jobs:
inlineScript: |
Copy-Item -Path ${{ github.workspace }}/src/EndpointManagerLauncher/bin/Release/netcoreapp3.1/win-x64/publish/ -Destination ${{ github.workspace }}/src/dsc/bin/Release/netcoreapp3.1/win-x64/publish/EndpointManagerLauncher -Recurse -Exclude **/*.pdb
azPSVersion: '3.1.0'
- name: Create .Zip files ({{ matrix.mode }})
- name: Create .Zip files (${{ matrix.mode }})
uses: TheDoctor0/zip-release@0.6.2
with:
type: 'zip'
filename: 'lpk-${{ matrix.mode }}.zip'
directory: ${{ github.workspace }}/src/dsc/bin/Release/netcoreapp3.1/${{ matrix.mode }}/publish
exclusions: '**/*.pdb **/*.xml **/*.nuspec **/cs/* **/de/* **/es/* **/fr/* **/it/* **/ja/* **/ko/* **/pl/* **/pt-BR/* **/ru/* **/tr/* **/zh-Hans/* **/zh-Hant/*'
- name: Create Build Number
- name: Upload Release
uses: actions/upload-artifact@v3
with:
name: lpk-${{ matrix.mode }}-artifact
path: ${{ github.workspace }}/src/dsc/bin/Release/netcoreapp3.1/${{ matrix.mode }}-x64/publish/lpk-${{ matrix.mode }}.zip
release:
runs-on: windows-latest
strategy:
matrix:
mode: [osx-x64,linux-x64,win-x64]
needs: build
steps:
- name: Create Release Number
id: build_number
uses: einaregilsson/build-number@v3
with:
Expand All @@ -55,13 +67,20 @@ jobs:
draft: false
prerelease: true
# body_path: CHANGELOG.md
- name: Upload Windows Release Asset
- name: Download ${{ matrix.mode }} artifact
uses: actions/download-artifact@v3
with:
name: lpk-${{ matrix.mode }}-artifact
- name: Upload ${{ matrix.mode }} Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: lpk-${{ matrix.mode }}-artifact
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/src/dsc/bin/Release/netcoreapp3.1/${{ matrix.mode }}/publish/lpk-${{ matrix.mode }}.zip
asset_name: lpk-${{ matrix.mode }}.zip
asset_content_type: application/zip



0 comments on commit 0b9b16c

Please sign in to comment.