-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (43 loc) · 1.35 KB
/
deploy-packages.yml
File metadata and controls
53 lines (43 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
on:
push:
branches:
- main
name: Deploy
jobs:
deploy-packages:
name: Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install --immutable
- run: yarn build
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload VSIX to Package-Specific Release
if: steps.changesets.outputs.published == 'true'
shell: bash
run: |
PACKAGE_NAME="urlspec-vscode-extension"
VERSION=$(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r ".[] | select(.name == \"$PACKAGE_NAME\") | .version")
if [ -n "$VERSION" ] && [ "$VERSION" != "null" ]; then
TAG_NAME="$PACKAGE_NAME@$VERSION"
echo "Target Tag: $TAG_NAME"
cd packages/$PACKAGE_NAME
VSIX_FILE=$(ls *.vsix)
gh release upload "$TAG_NAME" "$VSIX_FILE" --clobber
else
echo "No update for $PACKAGE_NAME in this release."
fi
env:
GITHUB_TOKEN: ${{ github.token }}