.NET #51
This file contains 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: .NET | |
on: | |
schedule: | |
- cron: "30 01 * * *" | |
jobs: | |
check_date: | |
runs-on: ubuntu-latest | |
name: Check latest commit | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: print latest_commit | |
run: echo ${{ github.sha }} | |
- id: should_run | |
continue-on-error: true | |
name: check latest commit is less than a day | |
if: ${{ github.event_name == 'schedule' }} | |
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" | |
build: | |
needs: check_date | |
if: ${{ needs.check_date.outputs.should_run != 'false' }} | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 9.0.x | |
include-prerelease: true | |
- name: Restore dependencies | |
run: dotnet restore | |
working-directory: FinModelUtility | |
- name: Build | |
shell: cmd | |
run: publish_universal_asset_tool.bat /f | |
working-directory: bat | |
- name: Zip files | |
run: Compress-Archive -Path cli/** -DestinationPath fin_model_utility.zip | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fin_model_utility | |
path: fin_model_utility.zip | |
create_release: | |
needs: build | |
runs-on: ubuntu-latest | |
if: ${{ needs.build.result == 'success' }} | |
steps: | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: nightly-${{ github.sha }} | |
release_name: "Nightly Build ${{ github.sha }}" | |
draft: false | |
prerelease: true | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: fin_model_utility.zip | |
asset_name: fin_model_utility.zip | |
asset_content_type: application/zip |