Skip to content

Commit 8a45cc5

Browse files
authored
rm deprecated action (#168)
* rm deprecated action * test new workflow * fix conditions * fix conditions * fix gh auth * add checkout, delete artifacts * check all steps * fix workflow * undo debug
1 parent ba0f200 commit 8a45cc5

File tree

1 file changed

+75
-26
lines changed

1 file changed

+75
-26
lines changed

.github/workflows/build-test-distribute.yml

Lines changed: 75 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ jobs:
218218
secrets:
219219
BUILD_MACHINE_TOKEN: ${{ secrets.BUILD_MACHINE_TOKEN }}
220220

221-
update-win-version-and-distribute:
221+
update-win-version:
222222
if: ${{ github.event_name == 'push' }}
223223
timeout-minutes: 15
224224
runs-on: windows-2019
@@ -250,18 +250,15 @@ jobs:
250250

251251
- name: Distribute
252252
run: py -3.10 scripts\zip_distribution.py MeshLibDist.zip
253-
253+
254254
- name: Upload Windows Distribution
255-
uses: actions/upload-release-asset@v1
256-
env:
257-
GITHUB_TOKEN: ${{ secrets.BUILD_MACHINE_TOKEN }}
255+
uses: actions/upload-artifact@v2
258256
with:
259-
upload_url: ${{ needs.versioning-and-release-url.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
260-
asset_path: MeshLibDist.zip
261-
asset_name: MeshLibDist_${{needs.versioning-and-release-url.outputs.version_tag}}.zip
262-
asset_content_type: application/zip
257+
name: WindowsDistribution
258+
path: MeshLibDist.zip
259+
retention-days: 1
263260

264-
update-deb-version-and-distribute:
261+
update-deb-version:
265262
if: ${{ github.event_name == 'push' }}
266263
timeout-minutes: 10
267264
runs-on: ubuntu-latest
@@ -293,16 +290,13 @@ jobs:
293290
MESHRUS_BUILD_DEBUG: OFF
294291

295292
- name: Upload Ubuntu Developer Distribution
296-
uses: actions/upload-release-asset@v1
297-
env:
298-
GITHUB_TOKEN: ${{ secrets.BUILD_MACHINE_TOKEN }}
293+
uses: actions/upload-artifact@v2
299294
with:
300-
upload_url: ${{ needs.versioning-and-release-url.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
301-
asset_path: ./distr/meshlib-dev.deb
302-
asset_name: meshlib_${{needs.versioning-and-release-url.outputs.version_tag}}-dev.deb
303-
asset_content_type: application/vnd.debian.binary-package
295+
name: UbuntuDistribution
296+
path: ./distr/meshlib-dev.deb
297+
retention-days: 1
304298

305-
update-rpm-version-and-distribute:
299+
update-rpm-version:
306300
if: ${{ github.event_name == 'push' }}
307301
timeout-minutes: 10
308302
runs-on: ubuntu-latest
@@ -334,19 +328,56 @@ jobs:
334328
MESHRUS_BUILD_DEBUG: OFF
335329

336330
- name: Upload Fedora Developer Distribution
337-
uses: actions/upload-release-asset@v1
338-
env:
339-
GITHUB_TOKEN: ${{ secrets.BUILD_MACHINE_TOKEN }}
331+
uses: actions/upload-artifact@v2
332+
with:
333+
name: FedoraDistribution
334+
path: meshlib-dev.rpm
335+
retention-days: 1
336+
337+
upload-distributions:
338+
if: ${{ github.event_name == 'push' }}
339+
timeout-minutes: 10
340+
runs-on: ubuntu-latest
341+
needs: [versioning-and-release-url, update-win-version, update-deb-version, update-rpm-version]
342+
steps:
343+
- name: Checkout
344+
uses: actions/checkout@v2
345+
with:
346+
submodules: recursive
347+
348+
- name: Download Windows Developer Distribution
349+
uses: actions/download-artifact@v2
340350
with:
341-
upload_url: ${{ needs.versioning-and-release-url.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
342-
asset_path: meshlib-dev.rpm
343-
asset_name: meshlib_${{needs.versioning-and-release-url.outputs.version_tag}}-dev.rpm
344-
asset_content_type: application/octet-stream
351+
name: WindowsDistribution
352+
353+
- name: Download Ubuntu Developer Distribution
354+
uses: actions/download-artifact@v2
355+
with:
356+
name: UbuntuDistribution
357+
358+
- name: Download Fedora Developer Distribution
359+
uses: actions/download-artifact@v2
360+
with:
361+
name: FedoraDistribution
362+
363+
- name: Rename Distributions
364+
run: |
365+
mv MeshLibDist.zip MeshLibDist_${{needs.versioning-and-release-url.outputs.version_tag}}.zip
366+
mv meshlib-dev.deb meshlib_${{needs.versioning-and-release-url.outputs.version_tag}}-dev.deb
367+
mv meshlib-dev.rpm meshlib_${{needs.versioning-and-release-url.outputs.version_tag}}-dev.rpm
368+
369+
- name: Upload Distributions
370+
run: |
371+
echo ${{ secrets.BUILD_MACHINE_TOKEN }} | gh auth login --with-token
372+
gh release upload ${{needs.versioning-and-release-url.outputs.version_tag}} \
373+
MeshLibDist_${{needs.versioning-and-release-url.outputs.version_tag}}.zip \
374+
meshlib_${{needs.versioning-and-release-url.outputs.version_tag}}-dev.deb \
375+
meshlib_${{needs.versioning-and-release-url.outputs.version_tag}}-dev.rpm
345376
346377
delete-artifacts:
347378
timeout-minutes: 15
348379
runs-on: ubuntu-latest
349-
needs: [update-win-version-and-distribute, update-deb-version-and-distribute, update-rpm-version-and-distribute]
380+
needs: [upload-distributions]
350381
if: always()
351382
steps:
352383
# all Windows
@@ -361,6 +392,12 @@ jobs:
361392
with:
362393
name: WindowsArchiveRelease
363394
failOnError: false
395+
396+
- name: Delete Windows Developer Distribution
397+
uses: geekyeggo/delete-artifact@v1
398+
with:
399+
name: WindowsDistribution
400+
failOnError: false
364401

365402
# all Ubuntu
366403
- name: Delete Ubuntu Binaries artifact
@@ -369,9 +406,21 @@ jobs:
369406
name: DebReleaseBinArchive
370407
failOnError: false
371408

409+
- name: Delete Ubuntu Developer Distribution
410+
uses: geekyeggo/delete-artifact@v1
411+
with:
412+
name: UbuntuDistribution
413+
failOnError: false
414+
372415
# all RPM
373416
- name: Delete Fedora Binaries artifact
374417
uses: geekyeggo/delete-artifact@v1
375418
with:
376419
name: RpmReleaseBinArchive
377420
failOnError: false
421+
422+
- name: Delete Fedora Developer Distribution
423+
uses: geekyeggo/delete-artifact@v1
424+
with:
425+
name: FedoraDistribution
426+
failOnError: false

0 commit comments

Comments
 (0)