Skip to content

Commit 8dcd50c

Browse files
authored
Replaced deprecated GitHub release action with a 3rd-party equivalent
1 parent 590961d commit 8dcd50c

File tree

1 file changed

+13
-33
lines changed

1 file changed

+13
-33
lines changed

.github/workflows/hello-world-2.8.1.yml

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
env:
142142
VCVARS_ARGS: ${{ matrix.vcvars-args }}
143143
run: |
144-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall" %VCVARS_ARGS%
144+
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall" %VCVARS_ARGS%
145145
cl /c /DBUILD_NUMBER=${{ env.BUILD_NUMBER }} test.cpp
146146
link /OUT:cpp.exe /SUBSYSTEM:CONSOLE test.obj
147147
@@ -170,50 +170,30 @@ jobs:
170170
runs-on: ubuntu-latest
171171

172172
steps:
173-
# create a draft GitHub release
174-
- name: Create a draft release
175-
id: create_release
176-
uses: actions/create-release@v1.1.4
177-
env:
178-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
179-
with:
180-
tag_name: ${{ env.VERSION }}
181-
release_name: v${{ env.VERSION }}
182-
draft: true
183-
184173
# download the artifact that was built in the `build` job in this workflow
185174
- name: Download Debian artifact
186175
uses: actions/download-artifact@v4
187176
with:
188177
name: hello-world-deb
189178
path: .
190179

191-
# upload the build artifact as a draft release asset
192-
- name: Upload a Debian Release Asset
193-
uses: actions/upload-release-asset@v4
194-
env:
195-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
196-
with:
197-
# use the upload URL from the step that created a release
198-
upload_url: ${{ steps.create_release.outputs.upload_url }}
199-
asset_path: ./hello-world-deb-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.tar.gz
200-
asset_name: hello-world-deb-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.tar.gz
201-
asset_content_type: application/tar+gzip
202-
203180
# same steps would be used for the x86 platform (not done in this script)
204181
- name: Download Windows x64 artifact
205182
uses: actions/download-artifact@v4
206183
with:
207184
name: hello-world-win-x64
208185
path: .
209186

210-
- name: Upload a Windows Release Asset
211-
uses: actions/upload-release-asset@v4
212-
env:
213-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
214-
with:
215-
# use the upload URL from the step that created a release
216-
upload_url: ${{ steps.create_release.outputs.upload_url }}
217-
asset_path: ./hello-world-win-x64-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.zip
218-
asset_name: hello-world-win-x64-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.zip
219187
asset_content_type: application/zip
188+
189+
- name: Create a draft release and upload artifacts
190+
uses: softprops/action-gh-release@v2
191+
with:
192+
token : ${{ secrets.GITHUB_TOKEN }}
193+
tag_name: ver-${{ env.VERSION }}
194+
target_commitish: ${{ github.ref_name }}
195+
name: cpp ${{ env.VERSION }}+${{ env.BUILD_NUMBER }}
196+
files: |
197+
./hello-world-deb-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.tar.gz
198+
./hello-world-win-x64-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.zip
199+
draft: true

0 commit comments

Comments
 (0)