Skip to content
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
47 changes: 8 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,42 +398,11 @@ jobs:

release:
name: Create Release
needs: [package, e2e-test]
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}

steps:
- name: Download VSIX artifact
uses: actions/download-artifact@v4
with:
name: mta-vsix-artifact-${{ github.run_number }}
path: ./artifacts

- name: Create GitHub release
run: |
VSIX_FILE=$(find ./artifacts -name "*.vsix" | head -1)
RELEASE_NAME="${{ github.ref_name }}"

gh release create "${{ github.ref_name }}" \
--title "MTA Extension $RELEASE_NAME" \
--notes "Migration Toolkit for Applications extension release $RELEASE_NAME

## Installation
Download the .vsix file and install using 'Extensions: Install from VSIX...' in VS Code.

## Changes
See the full changelog in the repository." \
"$VSIX_FILE"
env:
GITHUB_TOKEN: ${{ github.token }}

# TODO: Add marketplace publishing when ready
# - name: Publish to VS Code Marketplace
# run: npx vsce publish --packagePath "$VSIX_FILE"
# env:
# VSCE_PAT: ${{ secrets.VSCE_PAT }}

# - name: Publish to Open VSX
# run: npx ovsx publish "$VSIX_FILE"
# env:
# OVSX_PAT: ${{ secrets.OVSX_PAT }}
needs: e2e-test
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: ./.github/workflows/release.yml
with:
tag_name: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref_name, '-') }}
vsix_artifact_name: "vsix-artifact"
secrets: inherit
110 changes: 110 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Release

on:
workflow_call:
inputs:
tag_name:
description: "Tag name for the release"
required: true
type: string
prerelease:
description: "Is this a pre-release?"
required: true
type: boolean
vsix_artifact_name:
description: "Name of the VSIX artifact to download"
required: false
type: string
default: "vsix-artifact"
workflow_run_id:
description: "Workflow run ID to download artifacts from"
required: false
type: string

env:
HUSKY: 0

jobs:
generate_changelog:
name: Generate Changelog
uses: konveyor/release-tools/.github/workflows/generate-changelog.yml@main
with:
version: ${{ inputs.tag_name }}
prev_version: $(gh api repos/${{ github.repository }}/releases/latest | jq -r '.tag_name')
repository: ${{ github.repository }}
ref: ${{ github.sha }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}

release:
name: Final Release
runs-on: ubuntu-latest
needs: generate_changelog
steps:
- name: Add release details to the step summary
run: |
cat >> "$GITHUB_STEP_SUMMARY" <<EOF
## Release Information
Tag: __${{ inputs.tag_name }}__
Pre-Release: __${{ inputs.prerelease }}__
VSIX Artifact: __${{ inputs.vsix_artifact_name }}__
Workflow Run ID: __${{ inputs.workflow_run_id || github.run_id }}__
EOF

- name: Checkout code
uses: actions/checkout@v4

- name: Download Changelog Artifact
uses: actions/download-artifact@v4
with:
name: changelog-artifact
path: ./artifacts

- name: Download VSIX Artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.vsix_artifact_name }}
path: ./artifacts

- name: Verify Downloaded Artifacts
run: ls -R ./artifacts/

- name: Find and set VSIX filename
id: vsix_info
run: |
VSIX_FILE=$(find ./artifacts -name "*.vsix" -type f | head -1)
VSIX_NAME=$(basename "$VSIX_FILE")
echo "vsix_path=$VSIX_FILE" >> "$GITHUB_OUTPUT"
echo "vsix_name=$VSIX_NAME" >> "$GITHUB_OUTPUT"
echo "Found VSIX: $VSIX_NAME at $VSIX_FILE"

- name: Set up Node.js for publishing
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Publish to VS Code Marketplace
if: ${{ inputs.prerelease == false }}
run: |
echo "Publishing ${{ steps.vsix_info.outputs.vsix_path }}"
if [ -f "./artifacts/release.md" ]; then
echo "Publishing with changelog"
npx @vscode/vsce publish --packagePath "${{ steps.vsix_info.outputs.vsix_path }}" --changelog-path "./artifacts/release.md"
else
echo "Publishing without changelog (file not found)"
npx @vscode/vsce publish --packagePath "${{ steps.vsix_info.outputs.vsix_path }}"
fi
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}

- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ inputs.tag_name }}
commit: ${{ github.sha }}
bodyFile: ./artifacts/release.md
artifacts: |
${{ steps.vsix_info.outputs.vsix_path }}
prerelease: ${{ inputs.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion mta-build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
upstream:
repository: konveyor/editor-extensions
# Will be updated to specific SHA from release-0.2 branch
ref: 7205d4fed6824e58f6b021c14e6ca3a7c42c3f4a
ref: 780434f0d9727c5acf97d6b88f75ad2ce26ed83a
semanticRef: release-0.2

# Maybe useful later
Expand Down
Loading