Extended diagnose commands with useful hints plus a lot of general ou… #83
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build win-x64 | |
run: dotnet publish src/Elmah.Io.Cli/Elmah.Io.Cli.csproj -c Release --runtime win-x64 --self-contained -o elmahio-win-x64 /p:AssemblyVersion=5.1.${{ github.run_number }} | |
- name: Build linux-x64 | |
run: dotnet publish src/Elmah.Io.Cli/Elmah.Io.Cli.csproj -c Release --runtime linux-x64 --self-contained -o elmahio-linux-x64 /p:AssemblyVersion=5.1.${{ github.run_number }} | |
- name: Build osx-x64 | |
run: dotnet publish src/Elmah.Io.Cli/Elmah.Io.Cli.csproj -c Release --runtime osx-x64 --self-contained -o elmahio-osx-x64 /p:AssemblyVersion=5.1.${{ github.run_number }} | |
- name: Pack .NET Core tool | |
run: dotnet pack -c Release src/Elmah.Io.Cli/Elmah.Io.Cli.csproj /p:Version=5.1.${{ github.run_number }} | |
- name: Pack executables | |
shell: bash | |
run: | | |
7z a -tzip "./artifacts/elmahio-win-x64.zip" "./elmahio-win-x64/*" | |
tar czvf "./artifacts/elmahio-linux-x64.tar.gz" "elmahio-linux-x64" | |
tar czvf "./artifacts/elmahio-osx-x64.tar.gz" "elmahio-osx-x64" | |
rm -r "elmahio-win-x64" | |
rm -r "elmahio-linux-x64" | |
rm -r "elmahio-osx-x64" | |
- name: Create the Release | |
id: create_release | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/create-release@v1.1.4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: 5.1.${{ github.run_number }} | |
release_name: Release 5.1.${{ github.run_number }} | |
draft: false | |
- name: Upload elmahio-win-x64.zip | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/upload-release-asset@v1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/elmahio-win-x64.zip | |
asset_name: elmahio-win-x64.zip | |
asset_content_type: application/zip | |
- name: Upload elmahio-linux-x64.zip | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/upload-release-asset@v1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/elmahio-linux-x64.tar.gz | |
asset_name: elmahio-linux-x64.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload elmahio-osx-x64.zip | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/upload-release-asset@v1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/elmahio-osx-x64.tar.gz | |
asset_name: elmahio-osx-x64.tar.gz | |
asset_content_type: application/gzip | |
- name: Push to nuget.org | |
run: dotnet nuget push src/Elmah.Io.Cli/nupkg/Elmah.Io.Cli.5.1.${{ github.run_number }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
if: ${{ github.event_name == 'push' }} |