From adb6aeeee56db39a2bb100fabbb6d23d55b9af1f Mon Sep 17 00:00:00 2001 From: Keelah Date: Sun, 13 Oct 2024 13:17:13 +0200 Subject: [PATCH] Changed pipeline logic (#213) * Changed pipeline logic * Fix to restore * FIX restore ? * Revert "FIX restore ?" This reverts commit fe327225111824f05a9b1075f1c9a4456811292b. * whoops --- .github/workflows/codeql-analysis.yml | 5 +++- .github/workflows/release.yml | 40 +++++++++++++++++++-------- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6982ab8..c2b1d31 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -3,6 +3,8 @@ name: "Code Analysis" on: push: # The master branch must be analyzed on a new commit branches: [ master ] + tags-ignore: + - '*' pull_request: # Any PR on master must be analyzed branches: [ master ] @@ -41,7 +43,8 @@ jobs: with: dotnet-version: ${{vars.DOTNET_VERSION}} - - run: dotnet restore + - name: Restore Solution + run: dotnet restore ./FASTER.sln - name: Build Solution run: dotnet build ./FASTER.sln --configuration Debug diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56808be..b72dfce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: # BUILD APP build: - + if: ( github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' ) || startsWith(github.ref, 'refs/tags/v') strategy: matrix: # runtime: [x64, x86] @@ -43,19 +43,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 # Install the .NET Core workload - name: Install .NET Core uses: actions/setup-dotnet@v4 with: dotnet-version: ${{vars.DOTNET_VERSION}} - + # Execute all unit tests in the solution - name: Execute unit tests run: dotnet test - + # Restore the application to populate the obj folder with RuntimeIdentifiers - name: Restore the application run: dotnet restore @@ -68,7 +66,7 @@ jobs: # Pub - name: Publish the application ${{ matrix.runtime }} - run: dotnet publish --configuration $env:Configuration -a $env:Runtime --self-contained true /p:useapphost=true --output .\$env:ZIP_NAME$env:Runtime ./FASTER/FASTER.csproj + run: dotnet publish --configuration $env:Configuration -a $env:Runtime --self-contained true -p:PublishSingleFile=true /p:useapphost=true --output .\$env:ZIP_NAME$env:Runtime ./FASTER/FASTER.csproj env: Runtime: ${{ matrix.runtime }} @@ -79,6 +77,28 @@ jobs: env: Runtime: ${{ matrix.runtime }} + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: build-${{ matrix.runtime }} + path: .\${{ env.ZIP_NAME}}${{ matrix.runtime }}.zip + + release: + needs: build + runs-on: windows-latest + steps: + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # required for tags history processing + + - name: Download x64 artifact + uses: actions/download-artifact@v2 + with: + name: build-x64 + path: ./artifacts + # Get version number - name: get-net-sdk-project-versions-action uses: kzrnm/get-net-sdk-project-versions-action@v2.0.0 @@ -186,11 +206,10 @@ jobs: uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - Runtime: ${{ matrix.runtime }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: .\${{ env.ZIP_NAME}}${{ env.Runtime }}.zip - asset_name: ${{ env.ZIP_NAME}}${{ env.Runtime }}.zip + asset_path: ./artifacts/${{ env.ZIP_NAME}}x64.zip + asset_name: ${{ env.ZIP_NAME}}x64.zip asset_content_type: application/zip # Create Nightly Release @@ -199,7 +218,6 @@ jobs: uses: andelf/nightly-release@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - Runtime: ${{ matrix.runtime }} with: tag_name: nightly name: 'Nightly Release v${{ env.VERSION }}' @@ -209,4 +227,4 @@ jobs: ${{ steps.get-changes.outputs.changes }} --- prerelease: true - files: .\${{ env.ZIP_NAME}}${{ env.Runtime }}.zip \ No newline at end of file + files: ./artifacts/${{ env.ZIP_NAME}}x64.zip \ No newline at end of file