Bump Swashbuckle.AspNetCore from 8.1.0 to 8.1.1 in /dev-proxy (#1129) #128
Workflow file for this run
This file contains hidden or 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: Release | |
on: | |
push: | |
tags: ['v*'] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
APP_DESCRIPTION: Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path. | |
APP_PUBLISHER: Dev Proxy | |
APP_DESCRIPTION_URL: https://aka.ms/devproxy | |
jobs: | |
publish_binaries: | |
name: Publish binaries | |
runs-on: [windows-latest] | |
environment: | |
name: gh_releases | |
permissions: | |
id-token: write | |
contents: read | |
strategy: | |
matrix: | |
architecture: | |
- win-x64 | |
- win-x86 | |
- linux-x64 | |
- linux-arm64 | |
- osx-x64 | |
env: | |
release: 'dev-proxy-${{ matrix.architecture }}-${{ github.ref_name }}' | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 | |
with: | |
dotnet-version: 9.0.x | |
- name: Rename executable for beta | |
if: contains(github.ref_name, '-beta') | |
run: | | |
pushd | |
cd ./dev-proxy | |
$content = Get-Content dev-proxy.csproj | |
$content -replace '<AssemblyName>devproxy</AssemblyName>', '<AssemblyName>devproxy-beta</AssemblyName>' | Set-Content dev-proxy.csproj | |
popd | |
- name: Set newVersionNotification for beta | |
if: contains(github.ref_name, '-beta') | |
run: | | |
pushd | |
cd ./dev-proxy | |
$content = Get-Content devproxyrc.json | |
$content -replace '"newVersionNotification": "stable"', '"newVersionNotification": "beta"' | Set-Content devproxyrc.json | |
popd | |
- name: Publish ${{ matrix.architecture }} | |
run: dotnet publish ./dev-proxy/dev-proxy.csproj -c Release -p:PublishSingleFile=true -p:InformationalVersion=$("${{ github.ref_name }}".Substring(1)) -r ${{ matrix.architecture }} --self-contained -o ./${{ env.release }} | |
- name: Build plugins | |
run: dotnet build ./dev-proxy-plugins/dev-proxy-plugins.csproj -p:InformationalVersion=$("${{ github.ref_name }}".Substring(1)) -c Release -r ${{ matrix.architecture }} --no-self-contained | |
- name: Build abstractions | |
if: matrix.architecture == 'win-x64' | |
run: dotnet build ./dev-proxy-abstractions/dev-proxy-abstractions.csproj -p:InformationalVersion=$("${{ github.ref_name }}".Substring(1)) -c Release --no-self-contained | |
- name: Add plugins to output | |
run: cp ./dev-proxy/bin/Release/net9.0/${{ matrix.architecture }}/plugins ./${{ env.release }} -r | |
- name: Remove unnecessary files | |
run: | | |
pushd | |
cd ./${{ env.release }} | |
Get-ChildItem -Filter *.pdb -Recurse | Remove-Item | |
Get-ChildItem -Filter *.deps.json -Recurse | Remove-Item | |
Get-ChildItem -Filter *.runtimeconfig.json -Recurse | Remove-Item | |
Get-ChildItem -Filter *.staticwebassets.endpoints.json -Recurse | Remove-Item | |
Get-ChildItem -Filter web.config -Recurse | Remove-Item | |
popd | |
- name: Install Sign CLI tool | |
run: dotnet tool install --tool-path . sign --version 0.9.1-beta.25181.2 | |
- name: Azure CLI Login | |
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0 | |
with: | |
client-id: ${{ secrets.DOTNET_APPLICATION_ID }} | |
tenant-id: ${{ secrets.DOTNET_TENANT_ID }} | |
allow-no-subscriptions: true | |
- name: Sign binaries | |
if: contains(matrix.architecture, 'win-') | |
working-directory: ./${{ env.release }} | |
shell: pwsh | |
run: > | |
../sign code azure-key-vault | |
**/dev*proxy* | |
--publisher-name "${{ env.APP_PUBLISHER }}" | |
--description "${{ env.APP_DESCRIPTION }}" | |
--description-url "${{ env.APP_DESCRIPTION_URL }}" | |
--azure-key-vault-tenant-id "${{ secrets.DOTNET_TENANT_ID }}" | |
--azure-key-vault-client-id "${{ secrets.DOTNET_APPLICATION_ID }}" | |
--azure-key-vault-certificate "${{ secrets.DOTNET_CERTIFICATE_NAME }}" | |
--azure-key-vault-url "${{ secrets.DOTNET_VAULT_URL }}" | |
--timestamp-url http://timestamp.digicert.com | |
--verbosity Debug | |
- name: Archive release ${{ env.release }} | |
uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # master | |
with: | |
filename: '../${{ env.release }}.zip' | |
directory: './${{ env.release }}' | |
- name: Release SHA256 hash | |
run: | | |
$(Get-FileHash ./${{ env.release }}.zip -Algorithm SHA256).Hash | |
- name: Upload release | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: binaries-${{ env.release }} | |
path: ./${{ env.release }}.zip | |
- name: Sign abstractions | |
if: matrix.architecture == 'win-x64' | |
shell: pwsh | |
run: > | |
./sign code azure-key-vault | |
./dev-proxy-abstractions/bin/Release/net9.0/dev-proxy-abstractions.dll | |
--publisher-name "${{ env.APP_PUBLISHER }}" | |
--description "${{ env.APP_DESCRIPTION }}" | |
--description-url "${{ env.APP_DESCRIPTION_URL }}" | |
--azure-key-vault-tenant-id "${{ secrets.DOTNET_TENANT_ID }}" | |
--azure-key-vault-client-id "${{ secrets.DOTNET_APPLICATION_ID }}" | |
--azure-key-vault-certificate "${{ secrets.DOTNET_CERTIFICATE_NAME }}" | |
--azure-key-vault-url "${{ secrets.DOTNET_VAULT_URL }}" | |
--timestamp-url http://timestamp.digicert.com | |
--verbosity Debug | |
- name: Archive abstractions | |
if: matrix.architecture == 'win-x64' | |
uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # master | |
with: | |
filename: '../../../../dev-proxy-abstractions-${{ github.ref_name }}.zip' | |
directory: './dev-proxy-abstractions/bin/Release/net9.0' | |
exclusions: '*.json' | |
- name: Upload abstractions | |
if: matrix.architecture == 'win-x64' | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: binaries-dev-proxy-abstractions-${{ github.ref_name }} | |
path: ./dev-proxy-abstractions-${{ github.ref_name }}.zip | |
- name: Add installer icon | |
if: contains(matrix.architecture, 'win-') | |
run: | | |
if ('${{ github.ref_name }}'.Contains('beta')) { | |
cp ./media/icon-beta.ico ./${{ env.release }} | |
} else { | |
cp ./media/icon.ico ./${{ env.release }} | |
} | |
- name: Update version in beta installer | |
if: contains(matrix.architecture, 'win-') && contains(github.ref_name, '-beta') | |
run: | | |
$content = Get-Content ./install-beta.iss | |
$content -replace '#define MyAppVersion .*', "#define MyAppVersion `"$("${{ github.ref_name }}".Substring(1))`"" | Set-Content ./install-beta.iss | |
- name: Set installer file name | |
id: installer | |
if: contains(matrix.architecture, 'win-') | |
run: | | |
if ('${{ github.ref_name }}'.Contains('beta')) { | |
Write-Output "filename=install-beta.iss" >> $env:GITHUB_OUTPUT | |
} else { | |
Write-Output "filename=install.iss" >> $env:GITHUB_OUTPUT | |
} | |
- name: Add install file | |
if: contains(matrix.architecture, 'win-') | |
run: cp ./${{ steps.installer.outputs.filename }} ./${{ env.release }} | |
- name: Build Installer | |
if: contains(matrix.architecture, 'win-') | |
run: ISCC.exe ${{ steps.installer.outputs.filename }} /F"dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}" | |
working-directory: ./${{ env.release }} | |
- name: Sign installer | |
if: contains(matrix.architecture, 'win-') | |
working-directory: ./${{ env.release }} | |
shell: pwsh | |
run: > | |
../sign code azure-key-vault | |
./dev-proxy-installer-*.exe | |
--publisher-name "${{ env.APP_PUBLISHER }}" | |
--description "${{ env.APP_DESCRIPTION }}" | |
--description-url "${{ env.APP_DESCRIPTION_URL }}" | |
--azure-key-vault-tenant-id "${{ secrets.DOTNET_TENANT_ID }}" | |
--azure-key-vault-client-id "${{ secrets.DOTNET_APPLICATION_ID }}" | |
--azure-key-vault-certificate "${{ secrets.DOTNET_CERTIFICATE_NAME }}" | |
--azure-key-vault-url "${{ secrets.DOTNET_VAULT_URL }}" | |
--timestamp-url http://timestamp.digicert.com | |
--verbosity Debug | |
- name: Upload Installer | |
if: contains(matrix.architecture, 'win-') | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: installer-dev-proxy-${{ github.ref_name }}-${{ matrix.architecture }} | |
path: ./${{ env.release }}/dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}.exe | |
- name: Installer SHA256 hash | |
if: contains(matrix.architecture, 'win-') | |
run: | | |
$(Get-FileHash ./${{ env.release }}/dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}.exe -Algorithm SHA256).Hash | |
create_release: | |
name: Create Release | |
needs: [publish_binaries] | |
environment: | |
name: gh_releases | |
runs-on: [windows-latest] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 | |
with: | |
path: output | |
- name: Release | |
uses: anton-yurchenko/git-release@ec9c5b5c36b27eaffc628785b9183eae54601200 # v6.0.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DRAFT_RELEASE: "false" | |
PRE_RELEASE: "false" | |
CHANGELOG_FILE: "CHANGELOG.md" | |
ALLOW_EMPTY_CHANGELOG: "true" | |
with: | |
args: | | |
output/binaries-*/*.zip | |
output/installer-*/*.exe | |
deploy_docker: | |
name: Publish Docker image | |
runs-on: ubuntu-latest | |
needs: [create_release] | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
# Required for multi-platform images | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | |
# Required for multi-platform images | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | |
with: | |
driver-opts: image=moby/buildkit:latest | |
- name: Log in to the Container registry | |
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=false | |
tags: | | |
type=semver,pattern={{version}} | |
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-beta') }} | |
type=raw,value=beta,enable=${{ contains(github.ref_name, '-beta') }} | |
labels: | | |
org.opencontainers.image.description=${{ env.APP_DESCRIPTION }} | |
annotations: | | |
org.opencontainers.image.description=${{ env.APP_DESCRIPTION }} | |
- name: Build and push Docker image | |
if: "!contains(github.ref_name, '-beta')" | |
id: push | |
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
annotations: ${{ steps.meta.outputs.annotations }} | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
DEVPROXY_VERSION=${{ steps.meta.outputs.version }} | |
- name: Build and push beta Docker image | |
if: contains(github.ref_name, '-beta') | |
id: push_beta | |
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 | |
with: | |
context: . | |
file: ./Dockerfile_beta | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
annotations: ${{ steps.meta.outputs.annotations }} | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
DEVPROXY_VERSION=${{ steps.meta.outputs.version }} | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
subject-digest: ${{ steps.push.outputs.digest || steps.push_beta.outputs.digest }} | |
push-to-registry: true |