Develop #75
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: | |
pull_request: | |
types: [closed] | |
branches: | |
- master | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Setup Node.js 22.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22.x | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Get New VSCode Extension changeset | |
run: | | |
changeset_files=$(find .changeset -name '*.md') | |
found=false | |
for file in $changeset_files; do | |
if grep -q "sqlanydb-tools-vscode" "$file"; then | |
found=true | |
break | |
fi | |
done | |
if [ "$found" = true ]; then | |
echo "VSCODE_CHANGED=true" >> $GITHUB_ENV | |
else | |
echo "VSCODE_CHANGED=false" >> $GITHUB_ENV | |
fi | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: npm run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Build and Publish VSCode Extension | |
if: env.VSCODE_CHANGED == 'true' | |
run: | | |
cd ./apps/sqlanydb-tools-vscode | |
npm run publish | |
env: | |
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }} |