devolutions-crypto 0.9.2

An abstraction layer for the cryptography used by Devolutions
Documentation
name: Deploy to production (Nugets)
on:
  workflow_dispatch:
    inputs:
      publish_core_nuget:
        description: "Publish Devolutions.Crypto.Core.*.nupkg"
        required: true
        type: boolean
      publish_dry_run:
        description: "Dry Run Mode"
        required: true
        type: boolean
jobs:
  deploy:
    runs-on: ubuntu-22.04
    environment: publish
    steps:
    - uses: actions/checkout@v4

    - name: Check out devolutions/actions
      uses: actions/checkout@v4
      with:
        path: ./.github/workflows
        ref: v1
        repository: Devolutions/actions
        token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}

    - name: Install toolbox
      uses: ./.github/workflows/toolbox-install
      with:
        github_token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}

    - name: Download Nugets Artifact
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        CI: true
      run: dv github download-artifact nugets-windows . devolutions-crypto

    - name: Extract Artifacts
      run: 7z x nugets-windows.zip -o./devolutions-crypto-nugets
  
    - name: Publish Core NuGet
      if: ${{ inputs.publish_core_nuget }}
      run: |
        COMMAND="dotnet nuget push ./devolutions-crypto-nugets/Devolutions.Crypto.Core.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json"

        if [ '${{ inputs.publish_dry_run }}' == 'true' ]; then
          echo "Dry Run : True"
        else
          echo "Dry Run : False"
        fi

        echo "Running : $COMMAND"

        if [ "${{ inputs.publish_dry_run }}" != "true" ]; then # if not dry run, actually run the command
          eval "$COMMAND"
        fi