|
| 1 | +name: Release desktop binaries |
| 2 | +on: |
| 3 | + release: |
| 4 | + types: |
| 5 | + - published |
| 6 | +jobs: |
| 7 | + github-release: |
| 8 | + name: Create GitHub release |
| 9 | + runs-on: ubuntu-latest |
| 10 | + needs: build-package |
| 11 | + steps: |
| 12 | + - name: Download Windows x64 package |
| 13 | + uses: actions/download-artifact@v3 |
| 14 | + with: |
| 15 | + name: windows-package |
| 16 | + path: win-pkg/ |
| 17 | + - name: Download macOS x64 package |
| 18 | + uses: actions/download-artifact@v3 |
| 19 | + with: |
| 20 | + name: mac-package |
| 21 | + path: mac-pkg/ |
| 22 | + - name: Download Linux x64 package |
| 23 | + uses: actions/download-artifact@v3 |
| 24 | + with: |
| 25 | + name: linux-package |
| 26 | + path: lnx-pkg/ |
| 27 | + - name: Rename output files |
| 28 | + run: | |
| 29 | + mv win-pkg/cosmos-migrate.exe cosmos-migrate-${{ github.ref_name }}-win-x64.exe |
| 30 | + mv mac-pkg/cosmos-migrate cosmos-migrate-${{ github.ref_name }}-mac-x64 |
| 31 | + mv lnx-pkg/cosmos-migrate cosmos-migrate-${{ github.ref_name }}-linux-x64 |
| 32 | + - name: Create GitHub release |
| 33 | + uses: softprops/action-gh-release@v1 |
| 34 | + with: |
| 35 | + files: | |
| 36 | + cosmos-migrate-${{ github.ref_name }}-win-x64.exe |
| 37 | + cosmos-migrate-${{ github.ref_name }}-mac-x64 |
| 38 | + cosmos-migrate-${{ github.ref_name }}-linux-x64 |
| 39 | + build-package: |
| 40 | + name: Build self-contained executables |
| 41 | + runs-on: ubuntu-latest |
| 42 | + container: mcr.microsoft.com/dotnet/sdk:7.0 |
| 43 | + steps: |
| 44 | + - name: Check .NET version |
| 45 | + run: dotnet --version |
| 46 | + - name: Checkout source code |
| 47 | + uses: actions/checkout@v3 |
| 48 | + - name: Build Windows x64 package |
| 49 | + run: | |
| 50 | + dotnet publish \ |
| 51 | + Core/Microsoft.DataTransfer.Core/Microsoft.DataTransfer.Core.csproj \ |
| 52 | + --configuration release \ |
| 53 | + --output win \ |
| 54 | + --self-contained true \ |
| 55 | + --runtime win-x64 \ |
| 56 | + -p:PublishSingleFile=true \ |
| 57 | + -p:DebugType=embedded \ |
| 58 | + -p:EnableCompressionInSingleFile=true \ |
| 59 | + -p:PublishReadyToRun=true \ |
| 60 | + -p:PublishTrimmed=true \ |
| 61 | + -p:Version=${{ github.ref_name }} \ |
| 62 | + -p:AssemblyName=cosmos-migrate |
| 63 | + - name: Upload Windows package |
| 64 | + uses: actions/upload-artifact@v3 |
| 65 | + with: |
| 66 | + name: windows-package |
| 67 | + path: win/cosmos-migrate.exe |
| 68 | + - name: Build macOS x64 package |
| 69 | + run: | |
| 70 | + dotnet publish \ |
| 71 | + Core/Microsoft.DataTransfer.Core/Microsoft.DataTransfer.Core.csproj \ |
| 72 | + --configuration release \ |
| 73 | + --output mac \ |
| 74 | + --self-contained true \ |
| 75 | + --runtime osx-x64 \ |
| 76 | + -p:PublishSingleFile=true \ |
| 77 | + -p:DebugType=embedded \ |
| 78 | + -p:EnableCompressionInSingleFile=true \ |
| 79 | + -p:PublishReadyToRun=true \ |
| 80 | + -p:PublishTrimmed=true \ |
| 81 | + -p:Version=${{ github.ref_name }} \ |
| 82 | + -p:AssemblyName=cosmos-migrate |
| 83 | + - name: Upload macOS package |
| 84 | + uses: actions/upload-artifact@v3 |
| 85 | + with: |
| 86 | + name: mac-package |
| 87 | + path: mac/cosmos-migrate |
| 88 | + - name: Build Linux x64 package |
| 89 | + run: | |
| 90 | + dotnet publish \ |
| 91 | + Core/Microsoft.DataTransfer.Core/Microsoft.DataTransfer.Core.csproj \ |
| 92 | + --configuration release \ |
| 93 | + --output linux \ |
| 94 | + --self-contained true \ |
| 95 | + --runtime linux-x64 \ |
| 96 | + -p:PublishSingleFile=true \ |
| 97 | + -p:DebugType=embedded \ |
| 98 | + -p:EnableCompressionInSingleFile=true \ |
| 99 | + -p:PublishReadyToRun=true \ |
| 100 | + -p:PublishTrimmed=true \ |
| 101 | + -p:Version=${{ github.ref_name }} \ |
| 102 | + -p:AssemblyName=cosmos-migrate |
| 103 | + - name: Upload Linux package |
| 104 | + uses: actions/upload-artifact@v3 |
| 105 | + with: |
| 106 | + name: linux-package |
| 107 | + path: linux/cosmos-migrate |
0 commit comments