Skip to content

Commit

Permalink
Changed pipeline logic (#213)
Browse files Browse the repository at this point in the history
* Changed pipeline logic

* Fix to restore

* FIX restore ?

* Revert "FIX restore ?"

This reverts commit fe32722.

* whoops
  • Loading branch information
Foxlider authored Oct 13, 2024
1 parent 4017482 commit adb6aee
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down Expand Up @@ -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
Expand Down
40 changes: 29 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -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 }}

Expand All @@ -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/[email protected]
Expand Down Expand Up @@ -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
Expand All @@ -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 }}'
Expand All @@ -209,4 +227,4 @@ jobs:
${{ steps.get-changes.outputs.changes }}
---
prerelease: true
files: .\${{ env.ZIP_NAME}}${{ env.Runtime }}.zip
files: ./artifacts/${{ env.ZIP_NAME}}x64.zip

0 comments on commit adb6aee

Please sign in to comment.