Skip to content

Package vscode-extension #15

Package vscode-extension

Package vscode-extension #15

name: Package vscode-extension
on:
workflow_dispatch:
inputs:
publish:
description: 'Publish to marketplaces'
default: false
type: boolean
prerelease:
description: 'Mark as pre-release'
default: false
type: boolean
target_macos:
description: 'macOS'
default: true
type: boolean
target_windows:
description: 'Windows'
default: false
type: boolean
target_linux:
description: 'Linux'
default: false
type: boolean
ref:
description: 'The branch, tag or SHA to checkout'
default: 'main'
type: string
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Set workflow start time
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M%S')"
- name: Set targets
id: set_targets
run: |
targets=""
if ${{ github.event.inputs.target_macos }}; then
targets="$targets darwin-x64 darwin-arm64"
fi
if ${{ github.event.inputs.target_windows }}; then
targets="$targets win32-x64"
fi
if ${{ github.event.inputs.target_linux }}; then
targets="$targets linux-x64"
fi
if [ -z "$targets" ]; then
echo "No targets specified"
exit 1
fi
echo "Building extension for targets: $targets"
echo "::set-output name=targets::$targets"
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Enforce HTTPS for submodules
run: git config --global url."https://github.com/".insteadOf "[email protected]:"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: packages/vscode-extension/package-lock.json
- name: Install dependencies
working-directory: packages/vscode-extension
run: npm ci
- name: Package extension
uses: HaaLeo/publish-vscode-extension@v1
id: package_extension
working-directory: packages/vscode-extension

Check failure on line 81 in .github/workflows/package-extension.yml

View workflow run for this annotation

GitHub Actions / Package vscode-extension

Invalid workflow file

The workflow is not valid. .github/workflows/package-extension.yml (Line: 81, Col: 9): Unexpected value 'working-directory'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
dryRun: true
pat: stub
target: ${{ steps.set_targets.outputs.targets }}
preRelease: ${{ github.event.inputs.prerelease }}
- name: Sanitize ref name for artifact upload
id: sanitize
run: |
ref_name=$(echo -n "${{ github.event.inputs.ref }}" | sed 's/[\\\/'"'"':<>|*?]/-/g')
echo "ref_name=$ref_name" >> $GITHUB_OUTPUT
- name: Upload extension artifact
uses: actions/upload-artifact@v4
with:
name: radon-ide-${{ steps.sanitize.outputs.ref_name }}-${{ steps.date.outputs.date }}
path: ${{ steps.package_extension.outputs.vsixPath }}
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
if: ${{ github.event.inputs.publish }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.package_extension.outputs.vsixPath }}
pat: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
if: ${{ github.event.inputs.publish }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
extensionFile: ${{ steps.package_extension.outputs.vsixPath }}
pat: ${{ secrets.OPENVSX_MARKETPLACE_TOKEN }}