Skip to content

Commit bfb18d3

Browse files
authored
Resolve GitHub Actions deprecation warnings (#1050)
1 parent cca4592 commit bfb18d3

File tree

3 files changed

+55
-91
lines changed

3 files changed

+55
-91
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v2
38+
uses: actions/checkout@v3
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL

.github/workflows/main.yml

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
outputs:
3232
taggedbranch: ${{ steps.find-branch.outputs.taggedbranch }}
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
3535
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
3636
- name: Find which branch the release tag points at
3737
id: find-branch
@@ -41,7 +41,7 @@ jobs:
4141
git fetch --depth=1 origin +refs/heads/*:refs/heads/*
4242
set -x
4343
TAGGEDBRANCH=$(git for-each-ref --points-at=${{github.sha}} --format='%(refname:lstrip=2)' refs/heads/)
44-
echo ::set-output name=taggedbranch::$TAGGEDBRANCH
44+
echo "taggedbranch=$TAGGEDBRANCH" >> $GITHUB_OUTPUT
4545
- name: Set an output
4646
id: set-version
4747
if: runner.os == 'Linux'
@@ -51,41 +51,41 @@ jobs:
5151
[ $GITHUB_EVENT_NAME == 'release' ] && VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/}
5252
CHANGELOG=$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d')
5353
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
54-
echo ::set-output name=changelog::$CHANGELOG
54+
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
5555
git tag -l | cat
5656
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1))
5757
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }}
58-
echo ::set-output name=version::$VERSION
58+
echo "version=$VERSION" >> $GITHUB_OUTPUT
5959
NAME=$(jq -r '.name' package.json)-$VERSION
60-
echo ::set-output name=name::$NAME
60+
echo "name=$NAME" >> $GITHUB_OUTPUT
6161
tmp=$(mktemp)
6262
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
6363
mkdir dist
6464
echo $VERSION > .version
6565
echo $NAME > .name
6666
- name: Use Node.js
67-
uses: actions/setup-node@v1
67+
uses: actions/setup-node@v3
6868
with:
69-
node-version: 14.x
69+
node-version: 16
7070
- run: npm install
7171
- name: lint
7272
if: runner.os == 'Linux'
7373
run: npm run lint
7474
- run: npm run compile
7575
- name: npm test
76-
uses: GabrielBB/xvfb-action@v1.0
76+
uses: coactions/setup-xvfb@v1
7777
with:
7878
run: npm run test
7979
- name: Build package
8080
if: runner.os == 'Linux'
8181
run: |
8282
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
83-
- uses: actions/upload-artifact@v2
83+
- uses: actions/upload-artifact@v3
8484
if: (runner.os == 'Linux') && (github.event_name != 'release')
8585
with:
8686
name: ${{ steps.set-version.outputs.name }}.vsix
8787
path: ${{ steps.set-version.outputs.name }}.vsix
88-
- uses: actions/upload-artifact@v2
88+
- uses: actions/upload-artifact@v3
8989
if: runner.os == 'Linux'
9090
with:
9191
name: meta
@@ -97,7 +97,7 @@ jobs:
9797
runs-on: ubuntu-latest
9898
needs: build
9999
steps:
100-
- uses: actions/download-artifact@v2
100+
- uses: actions/download-artifact@v3
101101
with:
102102
name: meta
103103
path: .
@@ -106,58 +106,43 @@ jobs:
106106
if: runner.os == 'Linux'
107107
run: |
108108
set -x
109-
echo ::set-output name=version::`cat .version`
110-
echo ::set-output name=name::`cat .name`
111-
- uses: actions/download-artifact@v2
109+
echo "version=`cat .version`" >> $GITHUB_OUTPUT
110+
echo "name=`cat .name`" >> $GITHUB_OUTPUT
111+
- uses: actions/download-artifact@v3
112112
with:
113113
name: ${{ steps.set-version.outputs.name }}.vsix
114114
- name: Create Release
115-
id: create_release
116-
uses: actions/create-release@v1
115+
id: create-release
116+
uses: softprops/action-gh-release@v0
117117
if: runner.os == 'Linux'
118-
env:
119-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120118
with:
121119
tag_name: v${{ steps.set-version.outputs.version }}
122-
release_name: v${{ steps.set-version.outputs.version }}
123120
prerelease: ${{ github.event_name != 'release' }}
124-
body: |
125-
Changes in this release
126-
${{ steps.set-version.outputs.changelog }}
127-
- name: Upload Release Asset
128-
id: upload-release-asset
129-
uses: actions/upload-release-asset@v1
130-
if: runner.os == 'Linux'
131-
env:
132-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133-
with:
134-
upload_url: ${{ steps.create_release.outputs.upload_url }}
135-
asset_path: ${{ steps.set-version.outputs.name }}.vsix
136-
asset_name: ${{ steps.set-version.outputs.name }}.vsix
137-
asset_content_type: application/zip
121+
files: ${{ steps.set-version.outputs.name }}.vsix
122+
token: ${{ secrets.GITHUB_TOKEN }}
138123
publish:
139124
needs: build
140125
if: github.event_name == 'release' && needs.build.outputs.taggedbranch == 'master'
141126
runs-on: ubuntu-latest
142127
steps:
143-
- uses: actions/checkout@v2
128+
- uses: actions/checkout@v3
144129
with:
145130
ref: master
146131
token: ${{ secrets.TOKEN }}
147-
- uses: actions/download-artifact@v2
132+
- uses: actions/download-artifact@v3
148133
with:
149134
name: meta
150135
path: .
151136
- name: Use Node.js
152-
uses: actions/setup-node@v1
137+
uses: actions/setup-node@v3
153138
with:
154-
node-version: 14.x
139+
node-version: 16
155140
- name: Prepare build
156141
id: set-version
157142
run: |
158143
VERSION=`cat .version`
159144
NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
160-
echo ::set-output name=name::`cat .name`
145+
echo "name=`cat .name`" >> $GITHUB_OUTPUT
161146
tmp=$(mktemp)
162147
git config --global user.name 'ProjectBot'
163148
git config --global user.email '[email protected]'
@@ -173,15 +158,12 @@ jobs:
173158
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
174159
- name: Upload Release Asset
175160
id: upload-release-asset
176-
uses: actions/upload-release-asset@v1
161+
uses: softprops/action-gh-release@v0
177162
if: runner.os == 'Linux'
178-
env:
179-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180163
with:
181-
upload_url: ${{ github.event.release.upload_url }}
182-
asset_path: ${{ steps.set-version.outputs.name }}.vsix
183-
asset_name: ${{ steps.set-version.outputs.name }}.vsix
184-
asset_content_type: application/zip
164+
tag_name: ${{ github.event.release.tag_name }}
165+
files: ${{ steps.set-version.outputs.name }}.vsix
166+
token: ${{ secrets.GITHUB_TOKEN }}
185167
- name: Publish to VSCode Marketplace
186168
run: |
187169
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \

.github/workflows/prerelease.yml

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
outputs:
2727
taggedbranch: ${{ steps.find-branch.outputs.taggedbranch }}
2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v3
3030
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
3131
- name: Find which branch the release tag points at
3232
id: find-branch
@@ -36,7 +36,7 @@ jobs:
3636
git fetch --depth=1 origin +refs/heads/*:refs/heads/*
3737
set -x
3838
TAGGEDBRANCH=$(git for-each-ref --points-at=${{github.sha}} --format='%(refname:lstrip=2)' refs/heads/)
39-
echo ::set-output name=taggedbranch::$TAGGEDBRANCH
39+
echo "taggedbranch=$TAGGEDBRANCH" >> $GITHUB_OUTPUT
4040
- name: Set an output
4141
id: set-version
4242
if: runner.os == 'Linux'
@@ -46,41 +46,41 @@ jobs:
4646
[ $GITHUB_EVENT_NAME == 'release' ] && VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/}
4747
CHANGELOG=$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d')
4848
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
49-
echo ::set-output name=changelog::$CHANGELOG
49+
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
5050
git tag -l | cat
5151
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1))
5252
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }}
53-
echo ::set-output name=version::$VERSION
53+
echo "version=$VERSION" >> $GITHUB_OUTPUT
5454
NAME=$(jq -r '.name' package.json)-$VERSION
55-
echo ::set-output name=name::$NAME
55+
echo "name=$NAME" >> $GITHUB_OUTPUT
5656
tmp=$(mktemp)
5757
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
5858
mkdir dist
5959
echo $VERSION > .version
6060
echo $NAME > .name
6161
- name: Use Node.js
62-
uses: actions/setup-node@v1
62+
uses: actions/setup-node@v3
6363
with:
64-
node-version: 14.x
64+
node-version: 16
6565
- run: npm install
6666
- name: lint
6767
if: runner.os == 'Linux'
6868
run: npm run lint
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 == 'Linux'
7676
run: |
7777
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
78-
- uses: actions/upload-artifact@v2
78+
- uses: actions/upload-artifact@v3
7979
if: (runner.os == 'Linux') && (github.event_name != 'release')
8080
with:
8181
name: ${{ steps.set-version.outputs.name }}.vsix
8282
path: ${{ steps.set-version.outputs.name }}.vsix
83-
- uses: actions/upload-artifact@v2
83+
- uses: actions/upload-artifact@v3
8484
if: runner.os == 'Linux'
8585
with:
8686
name: meta
@@ -92,7 +92,7 @@ jobs:
9292
runs-on: ubuntu-latest
9393
needs: build
9494
steps:
95-
- uses: actions/download-artifact@v2
95+
- uses: actions/download-artifact@v3
9696
with:
9797
name: meta
9898
path: .
@@ -101,58 +101,43 @@ jobs:
101101
if: runner.os == 'Linux'
102102
run: |
103103
set -x
104-
echo ::set-output name=version::`cat .version`
105-
echo ::set-output name=name::`cat .name`
106-
- uses: actions/download-artifact@v2
104+
echo "version=`cat .version`" >> $GITHUB_OUTPUT
105+
echo "name=`cat .name`" >> $GITHUB_OUTPUT
106+
- uses: actions/download-artifact@v3
107107
with:
108108
name: ${{ steps.set-version.outputs.name }}.vsix
109109
- name: Create Pre-Release
110-
id: create_release
111-
uses: actions/create-release@v1
110+
id: create-release
111+
uses: softprops/action-gh-release@v0
112112
if: runner.os == 'Linux'
113-
env:
114-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115113
with:
116114
tag_name: v${{ steps.set-version.outputs.version }}
117-
release_name: v${{ steps.set-version.outputs.version }}
118115
prerelease: ${{ github.event_name != 'release' }}
119-
body: |
120-
Changes in this pre-release
121-
${{ steps.set-version.outputs.changelog }}
122-
- name: Upload Pre-Release Asset
123-
id: upload-release-asset
124-
uses: actions/upload-release-asset@v1
125-
if: runner.os == 'Linux'
126-
env:
127-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128-
with:
129-
upload_url: ${{ steps.create_release.outputs.upload_url }}
130-
asset_path: ${{ steps.set-version.outputs.name }}.vsix
131-
asset_name: ${{ steps.set-version.outputs.name }}.vsix
132-
asset_content_type: application/zip
116+
files: ${{ steps.set-version.outputs.name }}.vsix
117+
token: ${{ secrets.GITHUB_TOKEN }}
133118
publish:
134119
needs: build
135120
if: github.event_name == 'release' && needs.build.outputs.taggedbranch == 'prerelease'
136121
runs-on: ubuntu-latest
137122
steps:
138-
- uses: actions/checkout@v2
123+
- uses: actions/checkout@v3
139124
with:
140125
ref: prerelease
141126
token: ${{ secrets.TOKEN }}
142-
- uses: actions/download-artifact@v2
127+
- uses: actions/download-artifact@v3
143128
with:
144129
name: meta
145130
path: .
146131
- name: Use Node.js
147-
uses: actions/setup-node@v1
132+
uses: actions/setup-node@v3
148133
with:
149-
node-version: 14.x
134+
node-version: 16
150135
- name: Prepare pre-release build
151136
id: set-version
152137
run: |
153138
VERSION=`cat .version`
154139
NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
155-
echo ::set-output name=name::`cat .name`
140+
echo "name=`cat .name`" >> $GITHUB_OUTPUT
156141
tmp=$(mktemp)
157142
git config --global user.name 'ProjectBot'
158143
git config --global user.email '[email protected]'
@@ -168,15 +153,12 @@ jobs:
168153
npx vsce package --pre-release -o ${{ steps.set-version.outputs.name }}.vsix
169154
- name: Upload Release Asset
170155
id: upload-release-asset
171-
uses: actions/upload-release-asset@v1
156+
uses: softprops/action-gh-release@v0
172157
if: runner.os == 'Linux'
173-
env:
174-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175158
with:
176-
upload_url: ${{ github.event.release.upload_url }}
177-
asset_path: ${{ steps.set-version.outputs.name }}.vsix
178-
asset_name: ${{ steps.set-version.outputs.name }}.vsix
179-
asset_content_type: application/zip
159+
tag_name: ${{ github.event.release.tag_name }}
160+
files: ${{ steps.set-version.outputs.name }}.vsix
161+
token: ${{ secrets.GITHUB_TOKEN }}
180162
- name: Publish to VSCode Marketplace
181163
run: |
182164
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \

0 commit comments

Comments
 (0)