|
| 1 | +name: 'Upload last-dev versions to MyGet' |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - dev |
| 7 | + |
| 8 | +jobs: |
| 9 | + main: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Setup .NET 6 |
| 13 | + uses: actions/setup-dotnet@v1 |
| 14 | + with: |
| 15 | + dotnet-version: '6.0.301' # I highly recommend fixing a version |
| 16 | + include-prerelease: true |
| 17 | + |
| 18 | + - uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: 'Add myget as source' |
| 21 | + run: | |
| 22 | + cd src |
| 23 | + dotnet new nugetconfig |
| 24 | + dotnet nuget add source https://www.myget.org/F/plotly-net-nightly/api/v3/index.json --name myget |
| 25 | + |
| 26 | + - name: 'Push packages' |
| 27 | + run: | |
| 28 | + # versioning |
| 29 | + commithash=$(git rev-parse --short HEAD) |
| 30 | + currtime=$(date +%s) |
| 31 | + echo "commit hash is $commithash" |
| 32 | + echo "time is $currtime" |
| 33 | + name=11.0.0-dev-$currtime-$commithash |
| 34 | + echo "name is $name" |
| 35 | + |
| 36 | + chmod +x build.sh |
| 37 | + ./build.sh |
| 38 | + |
| 39 | + cd src |
| 40 | + |
| 41 | + # Plotly.NET |
| 42 | + cd ./Plotly.NET |
| 43 | + dotnet restore Plotly.NET.fsproj |
| 44 | + dotnet build Plotly.NET.fsproj -c release |
| 45 | + dotnet pack Plotly.NET.fsproj -c release -p:PackageVersion=$name |
| 46 | + cd bin/release |
| 47 | + dotnet nuget push Plotly.NET.$name.nupkg --api-key ${{ secrets.MYGET_KEY }} --source "myget" |
| 48 | + cd ../../.. |
| 49 | + echo 'Pushed Plotly.NET!' |
| 50 | + |
| 51 | + # Plotly.NET.Interactive |
| 52 | + cd ./Plotly.NET.Interactive |
| 53 | + dotnet remove package Plotly.NET |
| 54 | + dotnet add reference ../Plotly.NET/Plotly.NET.fsproj |
| 55 | + dotnet restore Plotly.NET.Interactive.fsproj |
| 56 | + dotnet build Plotly.NET.Interactive.fsproj -c release |
| 57 | + dotnet pack Plotly.NET.Interactive.fsproj -c release -p:PackageVersion=$name |
| 58 | + cd bin/release |
| 59 | + dotnet nuget push Plotly.NET.Interactive.$name.nupkg --api-key ${{ secrets.MYGET_KEY }} --source "myget" |
| 60 | + cd ../../.. |
| 61 | + echo 'Pushed Plotly.NET.Interactive!' |
| 62 | + |
| 63 | + # Plotly.NET.ImageExport |
| 64 | + cd ./Plotly.NET.ImageExport |
| 65 | + dotnet remove package Plotly.NET |
| 66 | + dotnet add reference ../Plotly.NET/Plotly.NET.fsproj |
| 67 | + dotnet restore Plotly.NET.ImageExport.fsproj |
| 68 | + dotnet build Plotly.NET.ImageExport.fsproj -c release |
| 69 | + dotnet pack Plotly.NET.ImageExport.fsproj -c release -p:PackageVersion=$name |
| 70 | + cd bin/release |
| 71 | + dotnet nuget push Plotly.NET.ImageExport.$name.nupkg --api-key ${{ secrets.MYGET_KEY }} --source "myget" |
| 72 | + cd ../../.. |
| 73 | + echo 'Pushed Plotly.NET.ImageExport!' |
| 74 | + |
| 75 | + # Plotly.NET.CSharp |
| 76 | + cd ./Plotly.NET.CSharp |
| 77 | + dotnet remove package Plotly.NET |
| 78 | + dotnet add reference ../Plotly.NET/Plotly.NET.fsproj |
| 79 | + dotnet restore Plotly.NET.CSharp.csproj |
| 80 | + dotnet build Plotly.NET.CSharp.csproj -c release |
| 81 | + dotnet pack Plotly.NET.CSharp.csproj -c release -p:PackageVersion=$name |
| 82 | + cd bin/release |
| 83 | + dotnet nuget push Plotly.NET.CSharp.$name.nupkg --api-key ${{ secrets.MYGET_KEY }} --source "myget" |
| 84 | + cd ../../.. |
| 85 | + echo 'Pushed Plotly.NET.CSharp!' |
0 commit comments