Run Build and Package #43
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: Run Build and Package | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
inputs: | |
publish_artifacts: | |
description: 'Publish artifacts' | |
required: true | |
default: 'true' | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
main: | |
runs-on: ${{ matrix.environment }} | |
strategy: | |
matrix: | |
environment: | |
- ubuntu-latest | |
fail-fast: false | |
env: | |
DOTNET_NOLOGO: 1 | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
NUGET_PACKAGES: ${{ github.workspace }}/.github/nuget-packages | |
steps: | |
- name: π Fetch Sources π | |
uses: actions/checkout@v4 | |
- name: π Build Sdk π | |
shell: bash | |
run: dotnet build -c Release src/sdk/FStarLang.Sdk.csproj | |
- name: π Build Runtime win-x64 π | |
shell: bash | |
run: dotnet build -r win-x64 -c Release src/runtime/FStarLang.Runtime.csproj | |
- name: π Build Runtime linux-x64 π | |
shell: bash | |
run: dotnet build -r linux-x64 -c Release src/runtime/FStarLang.Runtime.csproj | |
- name: π Build Runtime osx-x64 π | |
shell: bash | |
run: dotnet build -r osx-x64 -c Release src/runtime/FStarLang.Runtime.csproj | |
- name: π Pack ProjectTemplates π | |
shell: bash | |
run: dotnet pack -c Release src/templates/FStarLang.DotNet.Common.ProjectTemplates.1.0.csproj | |
- uses: actions/[email protected] | |
with: | |
name: nuget | |
path: artifacts/package/release | |
if-no-files-found: error | |
retention-days: 1 | |
publish: | |
runs-on: ubuntu-latest | |
needs: [main] | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: nuget | |
path: artifacts/package/release/ | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
- name: Publish nuget package | |
run: dotnet nuget push "artifacts/package/release/*.nupkg" --source https://codevision.pkgs.visualstudio.com/FStarLang/_packaging/fstarlang/nuget/v3/index.json --api-key ${{ secrets.AZ_DEVOPS_KEY }} --skip-duplicate | |
if: github.event_name == 'push' || github.event.inputs.publish_artifacts == 'true' |