Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix versioning issues for publishing to Azure Marketplace #687

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we've had these commented out for a long time. doesn't look like we have a backlog item to address it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, we have a timeframe already for deleting our Bicep fork.

# - 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 All @@ -198,7 +184,7 @@ jobs:
- name: Copy VSIX to release
run: >
mkdir -p ${{ env.RELEASE_PATH }}/vscode &&
cp ./src/vscode-bicep/vscode-bicep.vsix ${{ env.RELEASE_PATH }}/rad-vscode-bicep.vsix
cp ./src/vscode-bicep/rad-vscode-bicep.vsix ${{ env.RELEASE_PATH }}/rad-vscode-bicep.vsix
- name: Upload VSIX to release
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,7 +286,6 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: oras-project/setup-oras@v1
with:
version: ${{ env.ORAS_VERSION }}
Expand All @@ -309,70 +295,11 @@ jobs:
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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this logic? What cases does this run for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is only publishing to the latest tag now? Don't we need to publish with the release version too since downloads in the radius repo expect a release version tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I looked into it more and looks like we still need this. adding it back in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my b

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to separate this into separate steps if it makes sense.

Example:

# We publish `rad-bicep` on every push to main so that it can be used by tests, and
# installed by dev-builds of Radius.
- name: publish binaries for push to main (latest)
  ...
# We publish `rad-bicep` for each release so it can be installed by release-builds of
# Radius.
- name: publish binaries for tagged release (vX.Y)
  ...

Just an idea, its more code but its also more self-documenting. Comments help a lot too, especially if we can explain why something needs to be done.

Making the differences clear in the code, can make it harder for someone to break in the future.

- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being removed? Seems like we should just update to check from the GHCR uploads?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of these steps reference our old azure storage blobs and version marker. we already upload everything to GHCR and github releases now, hopefully we don't depend on these resources anymore. is there something I'm missing?

Copy link
Contributor

@sk593 sk593 Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not necessarily. This step just seems to be making sure we're not overwriting the current release with an old version. So the question was more so should we keep this step but just reference the github release version instead of from blob storage. The steps where an upload to blob storage happens make sense to delete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

talked offline, looks like we're good here

# 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-setversion && 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.0.0",
"cloudBuild": {
"setVersionVariables": false
}
},
"publicReleaseRefSpec": [
"^refs/tags/v\\d+\\.\\d+.\\d+"
]
}
Loading