Release #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
publishToMarketPlace: | |
description: 'Publish to VS Code Marketplace ?' | |
required: true | |
type: choice | |
options: | |
- 'true' | |
- 'false' | |
default: 'true' | |
jobs: | |
packaging-job: | |
runs-on: ubuntu-latest | |
env: | |
EXTENSION_NAME: aem-github-copilot | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
path: release | |
node-version: 20 | |
- name: Install dependencies | |
run: | | |
npm install -g typescript "@vscode/vsce" "ovsx" | |
echo "EXT_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV | |
- name: Build Extension | |
run: | | |
npm install | |
npm run build | |
- name: Package | |
run: | | |
vsce package -o ${{ env.EXTENSION_NAME }}-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix | |
sha256sum *.vsix > ${{ env.EXTENSION_NAME }}-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix.sha256 | |
ls -lash *.vsix *.sha256 | |
- name: Upload VSIX Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.EXTENSION_NAME }} | |
path: ${{ env.EXTENSION_NAME }}-${{ env.EXT_VERSION }}-${{github.run_number}}*.vsix | |
if-no-files-found: error | |
- name: Publish to GH Release Tab | |
if: ${{ inputs.publishToMarketPlace == 'true' }} | |
uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.EXT_VERSION }}" | |
draft: true | |
files: | | |
${{ env.EXTENSION_NAME }}-${{ env.EXT_VERSION }}-${{github.run_number}}*.vsix | |
${{ env.EXTENSION_NAME }}-${{ env.EXT_VERSION }}-${{github.run_number}}*.sha256 | |
release-job: | |
if: ${{ inputs.publishToMarketPlace == 'true' }} | |
environment: ${{ (inputs.publishToMarketPlace == 'true') && 'release' || 'pre-release' }} | |
runs-on: ubuntu-latest | |
needs: packaging-job | |
env: | |
EXTENSION_NAME: aem-github-copilot | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: | | |
npm install -g typescript "@vscode/vsce" "ovsx" | |
echo "EXT_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV | |
npm install | |
- name: Download VSIX Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Publish to VS Code Marketplace | |
if: ${{ github.event_name == 'schedule' || inputs.publishToMarketPlace == 'true' }} | |
run: | | |
vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath aem-github-copilot/${{ env.EXTENSION_NAME }}-${{ env.EXT_VERSION }}-${GITHUB_RUN_NUMBER}.vsix |