2828 version : ${{ steps.set-version.outputs.version }}
2929 taggedbranch : ${{ steps.find-branch.outputs.taggedbranch }}
3030 steps :
31- - uses : actions/checkout@v2
31+ - uses : actions/checkout@v3
3232 - run : git fetch --depth=1 origin +refs/tags/*:refs/tags/*
3333 - name : Find which branch the release tag points at
3434 id : find-branch
3838 git fetch --depth=1 origin +refs/heads/*:refs/heads/*
3939 set -x
4040 TAGGEDBRANCH=$(git for-each-ref --points-at=${{github.sha}} --format='%(refname:lstrip=2)' refs/heads/)
41- echo ::set-output name= taggedbranch:: $TAGGEDBRANCH
41+ echo " taggedbranch= $TAGGEDBRANCH" >> $GITHUB_OUTPUT
4242 - name : Set an output
4343 id : set-version
4444 if : runner.os == 'Windows'
@@ -49,33 +49,33 @@ jobs:
4949 [ $GITHUB_EVENT_NAME == 'release' ] && VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/}
5050 CHANGELOG=$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d')
5151 CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
52- echo ::set-output name= changelog:: $CHANGELOG
52+ echo " changelog= $CHANGELOG" >> $GITHUB_OUTPUT
5353 git tag -l | cat
5454 [ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1))
5555 [ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }}
56- echo ::set-output name= version:: $VERSION
56+ echo " version= $VERSION" >> $GITHUB_OUTPUT
5757 NAME=$(jq -r '.name' package.json)-$VERSION
58- echo ::set-output name=name:: $NAME
58+ echo " name=$NAME" >> $GITHUB_OUTPUT
5959 tmp=$(mktemp)
6060 jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
6161 mkdir dist
6262 echo $VERSION > .version
6363 echo $NAME > .name
6464 - name : Use Node.js
65- uses : actions/setup-node@v1
65+ uses : actions/setup-node@v3
6666 with :
67- node-version : 14.x
67+ node-version : 18
6868 - run : npm install
6969 - run : npm run compile
7070 - name : npm test
71- uses : GabrielBB/xvfb-action @v1.0
71+ uses : coactions/setup-xvfb @v1
7272 with :
7373 run : npm run test
7474 - name : Build pre-release package
7575 if : runner.os == 'Windows'
7676 run : |
77- npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
78- - uses : actions/upload-artifact@v2
77+ npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix --githubBranch prerelease
78+ - uses : actions/upload-artifact@v4.4.2
7979 if : (runner.os == 'Windows') && (github.event_name != 'release')
8080 with :
8181 name : ${{ steps.set-version.outputs.name }}.vsix
@@ -85,46 +85,33 @@ jobs:
8585 runs-on : windows-latest
8686 needs : build
8787 steps :
88- - uses : actions/download-artifact@v2
88+ - uses : actions/download-artifact@v4.1.7
8989 with :
9090 name : ${{ needs.build.outputs.name }}.vsix
9191 - name : Create Pre-Release
9292 id : create_release
93- uses : actions/create-release@v1
94- if : runner.os == 'Windows'
93+ uses : softprops/action-gh-release@v1
9594 env :
9695 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9796 with :
9897 tag_name : v${{ needs.build.outputs.version }}
99- release_name : v${{ needs.build.outputs.version }}
98+ name : v${{ needs.build.outputs.version }}
10099 prerelease : ${{ github.event_name != 'release' }}
101- body : |
102- Changes in this pre-release
103- ${{ needs.build.outputs.changelog }}
104- - name : Upload Pre-Release Asset
105- id : upload-release-asset
106- uses : actions/upload-release-asset@v1
107- if : runner.os == 'Windows'
108- env :
109- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
110- with :
111- upload_url : ${{ steps.create_release.outputs.upload_url }}
112- asset_path : ${{ needs.build.outputs.name }}.vsix
113- asset_name : ${{ needs.build.outputs.name }}.vsix
114- asset_content_type : application/zip
100+ token : ${{ secrets.GITHUB_TOKEN }}
101+ files : ${{ needs.build.outputs.name }}.vsix
115102 publish :
116103 needs : build
117104 if : github.event_name == 'release' && needs.build.outputs.taggedbranch == 'prerelease'
118105 runs-on : windows-latest
119106 steps :
120- - uses : actions/checkout@v2
107+ - uses : actions/checkout@v3
121108 with :
122109 ref : prerelease
123110 token : ${{ secrets.TOKEN }}
124111 - name : Use Node.js
125- uses : actions/setup-node@v1
112+ uses : actions/setup-node@v3
126113 with :
127- node-version : 14.x
114+ node-version : 18
128115 - name : Prepare pre-release build
129116 id : set-version
130117 shell : bash
@@ -136,25 +123,21 @@ jobs:
136123 git config --global user.email '[email protected] ' 137124 jq --arg version "${NEXT_VERSION}-SNAPSHOT" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
138125 git add package.json
139- git commit -m 'auto bump version after pre-release'
126+ git commit -m 'auto bump version after pre-release [skip ci] '
140127 jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
141128 npm install
142129 jq 'del(.enableProposedApi,.enabledApiProposals)' package.json > "$tmp" && mv "$tmp" package.json
143130 git push
144131 - name : Build pre-release package
145132 run : |
146- npx vsce package --pre-release -o ${{ needs.build.outputs.name }}.vsix
133+ npx vsce package --pre-release -o ${{ needs.build.outputs.name }}.vsix --githubBranch prerelease
147134 - name : Upload Release Asset
148135 id : upload-release-asset
149- uses : actions/upload-release-asset@v1
150- if : runner.os == 'Windows'
151- env :
152- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
136+ uses : softprops/action-gh-release@v1
153137 with :
154- upload_url : ${{ github.event.release.upload_url }}
155- asset_path : ${{ needs.build.outputs.name }}.vsix
156- asset_name : ${{ needs.build.outputs.name }}.vsix
157- asset_content_type : application/zip
138+ tag_name : ${{ github.event.release.tag_name }}
139+ files : ${{ needs.build.outputs.name }}.vsix
140+ token : ${{ secrets.GITHUB_TOKEN }}
158141 - name : Publish to VSCode Marketplace
159142 shell : bash
160143 run : |
0 commit comments