File tree Expand file tree Collapse file tree 4 files changed +28
-18
lines changed
Expand file tree Collapse file tree 4 files changed +28
-18
lines changed Original file line number Diff line number Diff line change 1+ name : ' Set Version from Branch'
2+ description : ' Sets VERSION environment variable from the current branch name'
3+
4+ runs :
5+ using : composite
6+ steps :
7+ - name : Set version from branch name
8+ shell : bash
9+ run : |
10+ # Use GITHUB_HEAD_REF for PRs, GITHUB_REF_NAME for direct pushes
11+ if [ -n "$GITHUB_HEAD_REF" ]; then
12+ BRANCH_NAME="$GITHUB_HEAD_REF"
13+ else
14+ BRANCH_NAME="$GITHUB_REF_NAME"
15+ fi
16+ echo "VERSION=$BRANCH_NAME" >> $GITHUB_ENV
17+ echo "Using version: $BRANCH_NAME"
Original file line number Diff line number Diff line change 6767 run : npm ci
6868
6969 - name : Set version from branch name
70- run : |
71- BRANCH_NAME="${GITHUB_REF#refs/heads/}"
72- echo "VERSION=$BRANCH_NAME" >> $GITHUB_ENV
73- echo "Using version: $BRANCH_NAME"
70+ uses : ./.github/actions/set-version
7471
7572 - name : Build VSIX package
7673 run : make vsix
Original file line number Diff line number Diff line change 11name : Publish to Open VSX
22
33on :
4+ push :
45 workflow_dispatch :
5- inputs :
6- version :
7- description : ' Version to publish (must match a build artifact)'
8- required : true
9- type : string
106
117permissions :
128 contents : read
@@ -28,13 +24,15 @@ jobs:
2824 - name : Install dependencies
2925 run : npm ci
3026
27+ - name : Set version from branch name
28+ uses : ./.github/actions/set-version
29+
3130 - name : Download VSIX artifact
3231 uses : actions/download-artifact@v4
3332 with :
34- name : vsix-${{ inputs.version }}
33+ name : vsix-${{ env.VERSION }}
3534
3635 - name : Publish to Open VSX
3736 run : make publish-ovsx
3837 env :
39- VERSION : ${{ inputs.version }}
4038 OVSX_PAT : ${{ secrets.OVSX_PAT }}
Original file line number Diff line number Diff line change 11name : Publish to Visual Studio Marketplace
22
33on :
4+ push :
45 workflow_dispatch :
5- inputs :
6- version :
7- description : ' Version to publish (must match a build artifact)'
8- required : true
9- type : string
106
117permissions :
128 contents : read
@@ -28,13 +24,15 @@ jobs:
2824 - name : Install dependencies
2925 run : npm ci
3026
27+ - name : Set version from branch name
28+ uses : ./.github/actions/set-version
29+
3130 - name : Download VSIX artifact
3231 uses : actions/download-artifact@v4
3332 with :
34- name : vsix-${{ inputs.version }}
33+ name : vsix-${{ env.VERSION }}
3534
3635 - name : Publish to VS Marketplace
3736 run : make publish-marketplace
3837 env :
39- VERSION : ${{ inputs.version }}
4038 VSCE_PAT : ${{ secrets.VSCE_PAT }}
You can’t perform that action at this time.
0 commit comments