Skip to content

Publish Sirji VS Code Extension #9

Publish Sirji VS Code Extension

Publish Sirji VS Code Extension #9

name: Publish Sirji VS Code Extension
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release from'
required: true
default: 'main'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install VSCE
run: npm install -g vsce
- name: Get package.json version
id: get_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./sirji/vscode-extension/package.json").version)')"
- name: Change directory and run all scripts
run: |
echo "Changing directory to sirji/vscode-extension"
cd sirji/vscode-extension
echo "Installing dependencies"
npm install
echo "Running pre publishing steps"
npm run vscode:prepublish
echo "Running pre-pack steps"
npm run prepack
echo "Packaging extension"
npm run package
- name: Upload to S3
run: |
echo "Uploading to S3"
aws s3 cp sirji/vscode-extension/sirji-${{ steps.get_version.outputs.version }}.vsix s3://$AWS_S3_BUCKET/sirji-${{ steps.get_version.outputs.version }}.vsix --acl public-read
echo "File uploaded to S3 bucket: https://s3.$AWS_REGION.amazonaws.com/$AWS_S3_BUCKET/sirji-${{ steps.get_version.outputs.version }}.vsix"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
AWS_S3_BUCKET: raised-staging-web-assets
# - name: Publish Extension
# run: |
# cd sirji/vscode-extension
# npm run publish -- -p ${{ secrets.VS_MARKETPLACE_PAT }}
# env:
# VS_MARKETPLACE_PAT: ${{ secrets.VS_MARKETPLACE_PAT }}