@@ -18,114 +18,56 @@ jobs:
1818 uses : actions/checkout@v5
1919 with :
2020 fetch-depth : 0
21-
22- - name : Setup Node.js
23- uses : actions/setup-node@v6
24- with :
25- node-version : " 20"
21+ persist-credentials : false
2622
2723 - name : Setup pnpm
2824 uses : pnpm/action-setup@v4
2925 with :
3026 version : 9.15.0
3127
28+ - name : Setup Node.js
29+ uses : actions/setup-node@v6
30+ with :
31+ node-version : " 22"
32+
3233 - name : Install just
3334 uses : extractions/setup-just@v3
3435
3536 - name : Install dependencies
3637 run : just deps
3738
38- - name : Get version
39- id : version
40- run : |
41- VERSION=$(node -p "require('./package.json').version")
42- echo "version=v$VERSION" >> $GITHUB_OUTPUT
43- echo "version_number=$VERSION" >> $GITHUB_OUTPUT
44- echo "📦 Version: v$VERSION"
45-
46- - name : Check if release exists
47- id : check
48- run : |
49- if gh release view "v$(node -p "require('./package.json').version")" &>/dev/null; then
50- echo "exists=true" >> $GITHUB_OUTPUT
51- echo "⚠️ Release already exists, skipping"
52- else
53- echo "exists=false" >> $GITHUB_OUTPUT
54- fi
55- env :
56- GH_TOKEN : ${{ github.token }}
57-
58- - name : Build extension
59- if : steps.check.outputs.exists == 'false'
39+ - name : Build and package
6040 run : just package
6141
62- - name : Generate changelog
63- id : changelog
64- if : steps.check.outputs.exists == 'false'
42+ - name : Configure Git
6543 run : |
66- CURRENT="v$(node -p "require('./package.json').version") "
67- PREVIOUS=$( git tag --sort=-v:refname | grep -v "$CURRENT" | head -1 || echo "")
44+ git config --global user.name "github-actions[bot] "
45+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
6846
69- if [ -z "$PREVIOUS" ]; then
70- echo "changelog=Initial release of quick command buttons extension" >> $GITHUB_OUTPUT
71- else
72- CHANGELOG=$(git log $PREVIOUS..HEAD --pretty=format:"- %s" --no-merges)
73- echo "changelog<<EOF" >> $GITHUB_OUTPUT
74- echo "$CHANGELOG" >> $GITHUB_OUTPUT
75- echo "EOF" >> $GITHUB_OUTPUT
76- fi
77-
78- - name : Create GitHub Release
79- if : steps.check.outputs.exists == 'false'
80- uses : softprops/action-gh-release@v2
81- with :
82- tag_name : ${{ steps.version.outputs.version }}
83- name : ${{ steps.version.outputs.version }}
84- body : |
85- ## 🎉 What's New in ${{ steps.version.outputs.version }}
86-
87- ${{ steps.changelog.outputs.changelog }}
88- files : |
89- quick-command-buttons-${{ steps.version.outputs.version_number }}.vsix
90- generate_release_notes : true
47+ - name : Run semantic-release
48+ run : npx semantic-release
9149 env :
92- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+ GITHUB_TOKEN : ${{ secrets.PAT_TOKEN }}
51+ GIT_AUTHOR_NAME : " github-actions[bot]"
52+ GIT_AUTHOR_EMAIL : " github-actions[bot]@users.noreply.github.com"
53+ GIT_COMMITTER_NAME : " github-actions[bot]"
54+ GIT_COMMITTER_EMAIL : " github-actions[bot]@users.noreply.github.com"
55+ HUSKY : 0
9356
9457 - name : Publish to marketplaces
95- if : steps.check.outputs.exists == 'false'
9658 run : just publish both
9759 env :
9860 VSCE_ACCESS_TOKEN : ${{ secrets.VSCE_PAT }}
9961 OVSX_ACCESS_TOKEN : ${{ secrets.OVSX_PAT }}
10062
101- - name : Update release with success status
102- if : success() && steps.check.outputs.exists == 'false'
103- run : |
104- TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
105- gh release view "${{ steps.version.outputs.version }}" --json body -q .body > body.txt
106- echo "" >> body.txt
107- echo "---" >> body.txt
108- echo "" >> body.txt
109- echo "✅ **Successfully published to both marketplaces!**" >> body.txt
110- echo "" >> body.txt
111- echo "- VSCode Marketplace: https://marketplace.visualstudio.com/items?itemName=KubrickCode.quick-command-buttons" >> body.txt
112- echo "- Open VSX Registry: https://open-vsx.org/extension/KubrickCode/quick-command-buttons" >> body.txt
113- echo "" >> body.txt
114- echo "🕐 Published at: $TIMESTAMP" >> body.txt
115- gh release edit "${{ steps.version.outputs.version }}" --notes-file body.txt
116- env :
117- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118-
119- - name : Update release on failure
120- if : failure() && steps.check.outputs.exists == 'false'
63+ - name : Sync release to main
12164 run : |
122- gh release view "${{ steps.version.outputs.version }}" --json body -q .body > body.txt
123- echo "" >> body.txt
124- echo "---" >> body.txt
125- echo "" >> body.txt
126- echo "❌ **Marketplace publishing failed!**" >> body.txt
127- echo "" >> body.txt
128- echo "Please check the GitHub Actions logs for details." >> body.txt
129- gh release edit "${{ steps.version.outputs.version }}" --notes-file body.txt
65+ git config user.name "github-actions[bot]"
66+ git config user.email "github-actions[bot]@users.noreply.github.com"
67+ git fetch origin release
68+ git fetch origin main
69+ git checkout main
70+ git merge origin/release --no-edit
71+ git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git main
13072 env :
131- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73+ GITHUB_TOKEN : ${{ secrets.PAT_TOKEN }}
0 commit comments