|
7 | 7 | - LICENSE |
8 | 8 | branches: |
9 | 9 | - "master" |
| 10 | + - "feature/*" |
10 | 11 | pull_request: |
11 | 12 | paths-ignore: |
12 | 13 | - "**.md" |
@@ -93,3 +94,105 @@ jobs: |
93 | 94 | **/*.trx |
94 | 95 | **/TestResults/**/* |
95 | 96 | retention-days: 7 |
| 97 | + |
| 98 | + continuous-deployment: |
| 99 | + name: "Continuous Deployment" |
| 100 | + runs-on: ubuntu-22.04 |
| 101 | + needs: build-and-test |
| 102 | + if: | |
| 103 | + github.repository == 'localstack-dotnet/localstack-dotnet-client' && |
| 104 | + github.event_name == 'push' && |
| 105 | + (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/feature/')) |
| 106 | + env: |
| 107 | + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages |
| 108 | + |
| 109 | + permissions: |
| 110 | + contents: read |
| 111 | + packages: write |
| 112 | + |
| 113 | + steps: |
| 114 | + - name: "Checkout" |
| 115 | + uses: actions/checkout@v4 |
| 116 | + with: |
| 117 | + fetch-depth: 0 |
| 118 | + |
| 119 | + - name: "Setup .NET SDK" |
| 120 | + uses: actions/setup-dotnet@v4 |
| 121 | + with: |
| 122 | + dotnet-version: | |
| 123 | + 8.0.x |
| 124 | + 9.0.x |
| 125 | +
|
| 126 | + - name: "Cache NuGet packages" |
| 127 | + uses: actions/cache@v4 |
| 128 | + with: |
| 129 | + path: ${{ github.workspace }}/.nuget/packages |
| 130 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/*.csproj', '**/Directory.Packages.props') }} |
| 131 | + restore-keys: | |
| 132 | + ${{ runner.os }}-nuget- |
| 133 | +
|
| 134 | + - name: "Make build script executable" |
| 135 | + run: chmod +x ./build.sh |
| 136 | + |
| 137 | + - name: "Setup GitHub Packages Configuration" |
| 138 | + run: | |
| 139 | + echo "🔐 Adding GitHub Packages authentication..." |
| 140 | + dotnet nuget add source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json \ |
| 141 | + --name github-packages \ |
| 142 | + --username ${{ github.actor }} \ |
| 143 | + --password ${{ secrets.GITHUB_TOKEN }} \ |
| 144 | + --store-password-in-clear-text |
| 145 | + |
| 146 | + echo "🔧 Original nuget.config..." |
| 147 | + cat nuget.config |
| 148 | + |
| 149 | + echo "📝 Backing up original nuget.config..." |
| 150 | + cp nuget.config nuget.config.backup |
| 151 | + |
| 152 | + echo "🔧 Using GitHub-optimized nuget.config..." |
| 153 | + cp .github/nuget.config nuget.config |
| 154 | +
|
| 155 | + echo "🔧 Replaced nuget.config..." |
| 156 | + cat nuget.config |
| 157 | +
|
| 158 | + - name: "Pack & Publish LocalStack.Client" |
| 159 | + run: | |
| 160 | + echo "🔨 Building and publishing LocalStack.Client package..." |
| 161 | + ./build.sh --target nuget-pack-and-publish \ |
| 162 | + --package-source github \ |
| 163 | + --package-id LocalStack.Client \ |
| 164 | + --use-directory-props-version true \ |
| 165 | + --branch-name ${{ github.ref_name }} \ |
| 166 | + --package-secret ${{ secrets.GITHUB_TOKEN }} |
| 167 | +
|
| 168 | + - name: "Pack & Publish LocalStack.Client.Extensions" |
| 169 | + run: | |
| 170 | + echo "🔨 Building and publishing LocalStack.Client.Extensions package..." |
| 171 | + ./build.sh --target nuget-pack-and-publish \ |
| 172 | + --package-source github \ |
| 173 | + --package-id LocalStack.Client.Extensions \ |
| 174 | + --use-directory-props-version true \ |
| 175 | + --branch-name ${{ github.ref_name }} \ |
| 176 | + --package-secret ${{ secrets.GITHUB_TOKEN }} |
| 177 | +
|
| 178 | + - name: "Upload Package Artifacts" |
| 179 | + uses: actions/upload-artifact@v4 |
| 180 | + with: |
| 181 | + name: "packages-${{ github.ref_name }}-${{ github.run_number }}" |
| 182 | + path: | |
| 183 | + artifacts/*.nupkg |
| 184 | + artifacts/*.snupkg |
| 185 | + retention-days: 7 |
| 186 | + |
| 187 | + - name: "Generate Build Summary" |
| 188 | + run: | |
| 189 | + echo "📦 Generating build summary..." |
| 190 | + ./build.sh --target workflow-summary \ |
| 191 | + --use-directory-props-version true \ |
| 192 | + --branch-name ${{ github.ref_name }} |
| 193 | +
|
| 194 | + - name: "Cleanup Configuration" |
| 195 | + if: always() |
| 196 | + run: | |
| 197 | + echo "🧹 Restoring original nuget.config..." |
| 198 | + mv nuget.config.backup nuget.config || echo "⚠️ Original config not found, skipping restore" |
0 commit comments