Merge pull request #374 from siemens/development #44
This file contains hidden or 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: Build & Release | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Restore Packages | |
| run: dotnet restore src\LicenseClearingTool.sln | |
| - name: Build | |
| run: dotnet build src\LicenseClearingTool.sln | |
| - name: Upload Build Output | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: buildoutput | |
| path: ${{ github.workspace }}/out/net8.0 | |
| - name: Upload Entire Output Directory | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: full-build-output | |
| path: ${{ github.workspace }}/out | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Download Build Output | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: buildoutput | |
| path: ${{ github.workspace }}/out/net8.0 | |
| - name: Build Docker Image | |
| run: | | |
| docker build . --file Dockerfile --tag ${{ github.repository }}:continuous-clearing-v8.3.0 | |
| docker save ${{ github.repository }}:continuous-clearing-v8.3.0 -o continuous-clearing-v8.3.0.tar | |
| - name: Upload Docker Image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-continuous-clearing | |
| path: | | |
| *.tar | |
| pack-nuget: | |
| runs-on: windows-latest | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Download Build Output | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: buildoutput | |
| path: ${{ github.workspace }}/out/net8.0 | |
| - name: Pack NuGet Package | |
| run: | | |
| nuget pack CA.nuspec -Version 8.3.0 | |
| - name: Upload NuGet Package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-continuous-clearing | |
| path: | | |
| *.nupkg | |
| release: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: windows-latest | |
| needs: [build, build-docker, pack-nuget] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Download Full Build Output | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: full-build-output | |
| path: ${{ github.workspace }}/out | |
| - name: Download Docker Image | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docker-continuous-clearing | |
| - name: Download NuGet Package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nuget-continuous-clearing | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v8.3.0 | |
| release_name: Release v8.3.0 | |
| body: | | |
| ${{ github.event.head_commit.message }} | |
| draft: true | |
| prerelease: false | |
| - name: Compress Full Build Output into ZIP | |
| run: | | |
| powershell -Command "& {Compress-Archive -Path ${{ github.workspace }}/out/* -DestinationPath ${{ github.workspace }}/continuous-clearing-v8.3.0.zip}" | |
| - name: Upload Full Build Output ZIP to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ${{ github.workspace }}/continuous-clearing-v8.3.0.zip | |
| asset_name: continuous-clearing-v8.3.0.zip | |
| asset_content_type: application/zip | |
| - name: Upload Docker Image(tar) to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./continuous-clearing-v8.3.0.tar | |
| asset_name: continuous-clearing-v8.3.0.tar | |
| asset_content_type: application/x-tar | |
| - name: Upload NuGet Package to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./continuous-clearing.8.3.0.nupkg | |
| asset_name: continuous-clearing.8.3.0.nupkg | |
| asset_content_type: application/octet-stream | |
| - name: Upload ReadmeOSS_nupkg file to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ${{ github.workspace }}/ReadmeOSS_continuous-clearing_nupkg.html | |
| asset_name: ReadmeOSS_continuous-clearing_nupkg.html | |
| asset_content_type: text/html | |
| - name: Upload ReadmeOSS_Docker file to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ${{ github.workspace }}/ReadmeOSS_continuous-clearing_DockerImage.html | |
| asset_name: ReadmeOSS_continuous-clearing_DockerImage.html | |
| asset_content_type: text/html |