Skip to content

Commit

Permalink
Fixing bicep problems for azure marketplace
Browse files Browse the repository at this point in the history
  • Loading branch information
willdavsmith committed Oct 31, 2023
1 parent c67fe7f commit 483c2ca
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 96 deletions.
85 changes: 6 additions & 79 deletions .github/workflows/radius-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ jobs:
name: release
path: ${{ env.RELEASE_PATH }}
if-no-files-found: error

vscode-bicep-build:
name: Build Bicep vscode extension
runs-on: ubuntu-latest
Expand Down Expand Up @@ -167,28 +168,13 @@ jobs:
- name: Build prod
run: npm run build:prod
working-directory: ./src/vscode-bicep

# Comment out while we troubleshoot the root cause of e2e errors
# - name: Build E2E tests
# run: npm run build:e2e
# working-directory: ./src/vscode-bicep

# - name: Run E2E tests
# run: xvfb-run -a npm run test:e2e
# working-directory: ./src/vscode-bicep

# - name: Show extension logs of E2E tests
# run: cat ./bicep.log
# if: always()
# working-directory: ./src/vscode-bicep

- name: Create VSIX
run: npm run package
working-directory: ./src/vscode-bicep
- name: Copy VSIX
run: >
mkdir -p ./artifacts/vscode &&
cp ./src/vscode-bicep/vscode-bicep.vsix ./artifacts/vscode/rad-vscode-bicep.vsix
cp ./src/vscode-bicep/rad-vscode-bicep.vsix ./artifacts/vscode/rad-vscode-bicep.vsix
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -250,7 +236,8 @@ jobs:
--title "Radius Bicep v${{ env.REL_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GH_RAD_CI_BOT_PAT }}
publish_ghcr:

publish:
if: ${{ github.event_name == 'push' }}
name: Publish to GHCR
needs: ["build", "vscode-bicep-build"]
Expand Down Expand Up @@ -299,80 +286,20 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: oras-project/setup-oras@v1
with:
version: ${{ env.ORAS_VERSION }}
- run: oras version
- name: Push rad bicep binaries to GHCR (${{ matrix.runtime.name }})
run: |
cd ./artifacts/bicep/${{ matrix.runtime.name }} && oras push --annotation "org.opencontainers.image.source=${{ env.IMAGE_SRC }}" ${{ env.CONTAINER_REGISTRY }}/bicep/rad-bicep/${{ matrix.runtime.name }}:${{ env.UPDATE_RELEASE == 'true' && env.REL_CHANNEL || 'latest' }} ./rad-bicep${{ matrix.runtime.extension }}
cd ./artifacts/bicep/${{ matrix.runtime.name }} && oras push --annotation "org.opencontainers.image.source=${{ env.IMAGE_SRC }}" ${{ env.CONTAINER_REGISTRY }}/bicep/rad-bicep/${{ matrix.runtime.name }}:latest ./rad-bicep${{ matrix.runtime.extension }}
- name: Check uploaded
run: curl --fail ${{ env.CONTAINER_REGISTRY }}/bicep/rad-bicep/${{ matrix.runtime.name }}:latest -v > out

# TODO: remove upload to blob storage once binaries are fully moved to GHCR
- uses: bacongobbler/[email protected]
name: Upload rad-bicep (${{ matrix.runtime.name }})
id: upload-rad-bicep
with:
container_name: ${{ secrets.ASSETS_STORAGE_CONTAINER }}
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
source_dir: ./artifacts/bicep/${{ matrix.runtime.name }}/
extra_args: "--destination-path ./bicep-extensibility/${{ env.REL_CHANNEL }}/${{ matrix.runtime.name }}/ --pattern rad-bicep${{ matrix.runtime.extension }} --overwrite true"
sync: true
- name: Check uploaded
run: curl --fail https://radiuspublic.blob.core.windows.net/tools/bicep-extensibility/${{ env.REL_CHANNEL }}/${{ matrix.runtime.name }}/rad-bicep${{ matrix.runtime.extension }} -v > out

# Only upload it once
- uses: bacongobbler/[email protected]
if: ${{ matrix.runtime.name == 'linux-x64' }}
name: Upload VS Code (channel)
with:
container_name: ${{ secrets.ASSETS_STORAGE_CONTAINER }}
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
source_dir: ./artifacts/vscode/
extra_args: "--destination-path ./vscode-extensibility/${{ env.REL_CHANNEL }}/ --overwrite true"
sync: true

# Logic: If this is a real release (tagged, non-rc) then compare to our existing full
# release and see if it's newer. This prevents a patch release of an older vintage from overwriting
# a newer release
- name: Download version marker file
run: |
curl https://radiuspublic.blob.core.windows.net/version/stable.txt -o current-stable.txt
if: ${{ success() && env.UPDATE_RELEASE == 'true' }}
- name: Get version
id: setcurrentversion
if: ${{ success() && env.UPDATE_RELEASE == 'true' }}
run: echo ::set-output name=version::$(cat current-stable.txt)
- name: Compare versions
uses: madhead/semver-utils@latest
if: ${{ success() && env.UPDATE_RELEASE == 'true' }}
id: compare
with:
version: ${{ env.REL_VERSION }}
compare-to: ${{ steps.setcurrentversion.outputs.version }}.0
- name: Print info (for sanity)
if: ${{ success() && env.UPDATE_RELEASE == 'true' }}
run: |
echo "current stable channel: ${{ steps.setcurrentversion.outputs.version }}"
echo "this build channel: ${{ env.REL_CHANNEL }}"
echo "this build version: ${{ env.REL_VERSION }}"
echo "comparison: ${{ steps.compare.outputs.comparison-result }}"
- uses: bacongobbler/[email protected]
name: Upload VS Code (stable)
if: ${{ success() && (steps.compare.outputs.comparison-result == '>' || steps.compare.outputs.comparison-result == '=')}}
with:
container_name: ${{ secrets.ASSETS_STORAGE_CONTAINER }}
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
source_dir: ./artifacts/vscode/
extra_args: "--destination-path ./vscode-extensibility/stable/ --overwrite true"
sync: true

delete_artifacts:
name: Delete artifacts
if: success()
needs: [ 'publish_ghcr' ]
needs: [ 'publish' ]
runs-on: ubuntu-latest
steps:
- name: Delete release artifacts
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
## 🏗️ UNDER CONSTRUCTION

This is a temporary fork of the official [Azure Bicep](https://github.com/Azure/bicep) to support [Radius](https://github.com/project-radius/radius) while we upstream our extensibility updates to the official Bicep repository. Once that is complete, we will deprecate this repository and users can use the official build of Bicep with Radius.
This is a temporary fork of the official [Azure Bicep](https://github.com/Azure/bicep) to support [Radius](https://github.com/radius-project/radius) while we upstream our extensibility updates to the official Bicep repository. Once that is complete, we will deprecate this repository and users can use the official build of Bicep with Radius.

Note that the main Bicep VSCode extension is not compatible with rad-bicep and must be disabled. There may also be small inconsistencies between the main Bicep release and rad-bicep until we complete the full extensibility experience.

For more information please visit https://docs.radapp.dev
For more information please visit https://docs.radapp.io

## FAQ

**What unique benefits do you get with Radius Bicep?**

1. Tooling to author and deploy Radius resources. Radius resources are application-centric and platform-agnostic, allowing apps to be written once and deployed to multiple platforms (_on-premises, Azure, AWS, etc._).
1. Tooling to author and deploy AWS resource types using the [AWS extensibility provider](https://github.com/project-radius/bicep-types-aws)
1. Tooling to author and deploy AWS resource types using the [AWS extensibility provider](https://github.com/radius-project/bicep-types-aws)

**Can you install both the official Bicep CLI and the Radius (rad) CLI?**

Expand Down
4 changes: 2 additions & 2 deletions src/Bicep.Cli.Nuget/Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<authors>Microsoft</authors>
<license type="expression">MIT</license>
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
<icon>bicep-logo-256.png</icon>
<icon>rad-vscode-bicep-logo.png</icon>
<projectUrl>https://github.com/Azure/bicep</projectUrl>
<description>Bicep Command Line Interface tool</description>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>Azure Bicep CLI compiler</tags>
</metadata>
<files>
<file src="..\icons\bicep-logo-256.png" target="bicep-logo-256.png" />
<file src="..\icons\rad-vscode-bicep-logo.png" target="rad-vscode-bicep-logo.png" />
<file src="build\Azure.Bicep.CommandLine.Common.props" target="build\" />
<!-- nuget convention requires .props file name to match package ID -->
<file src="build\Azure.Bicep.CommandLine.RID.props" target="build\Azure.Bicep.CommandLine.$rid$.props" />
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>Azure;Bicep;$(PackageTags)</PackageTags>
<PackageIconUrl><!-- Don't set this field (deprecated) --></PackageIconUrl>
<PackageIcon>bicep-logo-256.png</PackageIcon>
<PackageIcon>rad-vscode-bicep-logo.png</PackageIcon>

<!-- generate symbols for upload to the nuget feed -->
<IncludeSymbols>true</IncludeSymbols>
Expand All @@ -47,7 +47,7 @@
</PropertyGroup>

<ItemGroup Condition="'$(EnableNuget)' == 'true'">
<None Include="$(MSBuildThisFileDirectory)\icons\bicep-logo-256.png" Pack="true" PackagePath="" Visible="false" />
<None Include="$(MSBuildThisFileDirectory)\icons\rad-vscode-bicep-logo.png" Pack="true" PackagePath="" Visible="false" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\BicepFileIcon.png" />
<Content Include="Icons\bicep-logo-256.png">
<Content Include="Icons\rad-vscode-bicep-logo.png">
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<DisplayName>Bicep for Visual Studio</DisplayName>
<Description xml:space="preserve">Bicep language support for Visual Studio.</Description>
<License>License.txt</License>
<Icon>Icons\bicep-logo-256.png</Icon>
<Icon>Icons\rad-vscode-bicep-logo.png</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.3, 18.0)">
Expand Down
10 changes: 9 additions & 1 deletion src/vscode-bicep/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Key features of the Bicep VS Code extension
## 🏗️ UNDER CONSTRUCTION

This is a temporary fork of the official [Azure Bicep](https://github.com/Azure/bicep) to support [Radius](https://github.com/radius-project/radius) while we upstream our extensibility updates to the official Bicep repository. Once that is complete, we will deprecate this repository and users can use the official build of Bicep with Radius.

Note that the main Bicep VSCode extension is not compatible with rad-bicep and must be disabled. There may also be small inconsistencies between the main Bicep release and rad-bicep until we complete the full extensibility experience.

For more information please visit https://docs.radapp.io

## Key features of the Bicep VS Code extension

The [Bicep VS Code extension](https://docs.microsoft.com/azure/azure-resource-manager/bicep/install#vs-code-and-bicep-extension) is capable of many of the features you would expect out of other language tooling. Here is a comprehensive list of the features that are currently implemented.

Expand Down
Binary file added src/vscode-bicep/icons/rad-vscode-bicep-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions src/vscode-bicep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"version": "0.0.0-placeholder",
"publisher": "ms-azuretools",
"icon": "icons/bicep-logo-256.png",
"icon": "icons/rad-vscode-bicep-logo.png",
"preview": false,
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
"engines": {
Expand All @@ -17,23 +17,24 @@
"Programming Languages"
],
"keywords": [
"Radius",
"Bicep",
"Azure Resource Manager",
"ARM Template",
"Azure"
],
"bugs": {
"url": "https://github.com/Azure/bicep/issues"
"url": "https://github.com/radius-project/bicep/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Azure/bicep"
"url": "https://github.com/radius-project/bicep"
},
"galleryBanner": {
"color": "E7F1FA",
"theme": "light"
},
"homepage": "https://github.com/Azure/bicep/blob/main/README.md",
"homepage": "https://github.com/radius-project/bicep/blob/main/README.md",
"activationEvents": [
"onLanguage:bicep",
"onCommand:bicep.build",
Expand Down Expand Up @@ -535,7 +536,7 @@
"test:update-snapshot": "jest --config jest.config.snapshot.js --updateSnapshot",
"testlocal:e2e": "(export BICEP_LANGUAGE_SERVER_PATH=${INIT_CWD}/../Bicep.LangServer/bin/Debug/net6.0/Bicep.LangServer.dll || set BICEP_LANGUAGE_SERVER_PATH=%INIT_CWD%/../Bicep.LangServer/bin/Debug/net6.0/Bicep.LangServer.dll) && npm run build && npm run build:e2e && npm run test:e2e",
"clean": "rimraf ./out ./coverage",
"package": "npm run clean && nbgv-setversion && vsce package --githubBranch main --out ./vscode-bicep.vsix && nbgv-setversion --reset",
"package": "npm run clean && nbgv set-version && vsce package --githubBranch bicep-extensibility --out ./rad-vscode-bicep.vsix && nbgv-setversion --reset",
"packagelocal": "rimraf ./bicepLanguageServer && cp -r ../Bicep.LangServer/bin/Debug/net6.0 ./bicepLanguageServer && npm run package",
"params": "node ./enableParams.js"
},
Expand Down
7 changes: 5 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.11",
"version": "0.26.8",
"cloudBuild": {
"setVersionVariables": false
}
},
"publicReleaseRefSpec": [
"^refs/tags/v\\d+\\.\\d+.\\d+"
]
}

0 comments on commit 483c2ca

Please sign in to comment.