-
Notifications
You must be signed in to change notification settings - Fork 7
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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: | ||
|
@@ -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"] | ||
|
@@ -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 }} | ||
|
@@ -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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we removing this logic? What cases does this run for? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my b There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
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+" | ||
] | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.