Skip to content

Commit 1467899

Browse files
committed
Use upload-artifacts in make-pear-app
Signed-off-by: Darshan Sen <raisinten@gmail.com>
1 parent 67be6b0 commit 1467899

2 files changed

Lines changed: 123 additions & 90 deletions

File tree

make-pear-app/action.yml

Lines changed: 123 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,44 @@ inputs:
7373
outputs:
7474
artifact-links:
7575
description: 'Links to uploaded artifacts'
76-
value: ${{ steps.upload-artifacts-bash.outputs.artifact-links || steps.upload-artifacts-pwsh.outputs.artifact-links }}
76+
value: ${{
77+
runner.os == 'Linux' && format(
78+
'{0}\n{1}\n{2}',
79+
format(
80+
'<{0}|{1}>',
81+
steps.upload-artifact-appimage.outputs.artifact-url,
82+
env.APPIMAGE_NAME
83+
),
84+
format(
85+
'<{0}|{1}>',
86+
steps.upload-artifact-snap.outputs.artifact-url,
87+
env.SNAP_NAME
88+
),
89+
format(
90+
'<{0}|{1}>',
91+
steps.upload-artifact-flatpak.outputs.artifact-url,
92+
env.FLATPAK_NAME
93+
),
94+
) ||
95+
runner.os == 'Windows' && format(
96+
'{0}\n{1}',
97+
format(
98+
'<{0}|{1}>',
99+
steps.upload-artifact-msix.outputs.artifact-url,
100+
env.MSIX_NAME
101+
),
102+
format(
103+
'<{0}|{1}>',
104+
steps.upload-artifact-zip.outputs.artifact-url,
105+
env.ZIP_NAME
106+
)
107+
) ||
108+
runner.os == 'macOS' && format(
109+
'<{0}|{1}>',
110+
steps.upload-artifact-dmg.outputs.artifact-url,
111+
env.DMG_NAME
112+
)
113+
}}
77114

78115
runs:
79116
using: composite
@@ -307,41 +344,93 @@ runs:
307344
run: |
308345
npm run make
309346
shell: pwsh
310-
- name: 'Install @actions/artifact module (Linux/macOS)'
311-
id: npm-root-bash
312-
if: ${{ runner.os != 'Windows' }}
313-
run: |
314-
npm install @actions/artifact@2.3.2 --global
315-
echo "path=$(npm root --quiet -g)" >> $GITHUB_OUTPUT
316-
shell: bash
317-
- name: 'Install @actions/artifact module (Windows)'
318-
id: npm-root-pwsh
319-
if: ${{ runner.os == 'Windows' }}
320-
run: |
321-
npm install @actions/artifact@2.3.2 --global
322-
$npmRoot = npm root --quiet -g
323-
Add-Content -Path $env:GITHUB_OUTPUT -Value "path=$npmRoot"
324-
shell: pwsh
325-
- name: 'Extract Actions runtime variables'
326-
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
347+
- id: upload-artifacts-appimage
348+
name: 'Upload appimage artifact'
349+
if: ${{ runner.os == 'Linux' }}
350+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
327351
env:
328-
GITHUB_TOKEN: ${{ github.token }}
352+
APPIMAGE_NAME: ${{ format(
353+
'{0}{1}-{2}-{3}.AppImage',
354+
inputs.name,
355+
inputs.channel != 'production' && format('-{0}', inputs.channel) || '',
356+
inputs.version,
357+
inputs.arch
358+
) }}
329359
with:
330-
script: |
331-
core.exportVariable('ACTIONS_RESULTS_URL', process.env['ACTIONS_RESULTS_URL'])
332-
core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL'])
333-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN'])
334-
- id: upload-artifacts-bash
335-
name: 'Upload folders as artifacts (Linux/macOS)'
336-
if: ${{ runner.os != 'Windows' }}
360+
name: ${{ env.APPIMAGE_NAME }}
361+
path: out/make/*.AppImage
362+
- id: upload-artifacts-snap
363+
name: 'Upload snap artifact'
364+
if: ${{ runner.os == 'Linux' && inputs.linux_set_up_snapcraft == 'true' }}
365+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
337366
env:
338-
NODE_PATH: '${{ steps.npm-root-bash.outputs.path }}'
339-
run: node ${{ github.action_path }}/upload-artifacts.cjs
340-
shell: bash
341-
- id: upload-artifacts-pwsh
342-
name: 'Upload folders as artifacts (Windows)'
367+
SNAP_NAME: ${{ format(
368+
'{0}{1}_{2}_{3}.snap',
369+
inputs.name,
370+
inputs.channel != 'production' && format('_{0}', inputs.channel) || '',
371+
inputs.version,
372+
inputs.arch == 'x64' && 'amd64' || 'arm64'
373+
) }}
374+
with:
375+
name: ${{ env.SNAP_NAME }}
376+
path: out/make/*.snap
377+
- id: upload-artifacts-flatpak
378+
name: 'Upload flatpak artifact'
379+
if: ${{ runner.os == 'Linux' }}
380+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
381+
env:
382+
FLATPAK_NAME: ${{ format(
383+
'{0}{1}_{2}_{3}_flatpak.tar.gz',
384+
inputs.name,
385+
inputs.channel != 'production' && format('_{0}', inputs.channel) || '',
386+
inputs.version,
387+
inputs.arch
388+
) }}
389+
with:
390+
name: ${{ env.FLATPAK_NAME }}
391+
path: out/make/*_flatpak.tar.gz
392+
- id: upload-artifacts-dmg
393+
name: 'Upload DMG artifact'
394+
if: ${{ runner.os == 'macOS' }}
395+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
396+
env:
397+
DMG_NAME: ${{ format(
398+
'{0}{1}-{2}-{3}.dmg',
399+
inputs.name,
400+
inputs.channel != 'production' && format('-{0}', inputs.channel) || '',
401+
inputs.version,
402+
inputs.arch
403+
) }}
404+
with:
405+
name: ${{ env.DMG_NAME }}
406+
path: out/make/*.dmg
407+
- id: upload-artifacts-msix
408+
name: 'Upload MSIX artifact'
343409
if: ${{ runner.os == 'Windows' }}
410+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
344411
env:
345-
NODE_PATH: '${{ steps.npm-root-pwsh.outputs.path }}'
346-
run: node ${{ github.action_path }}/upload-artifacts.cjs
347-
shell: pwsh
412+
MSIX_NAME: ${{ format(
413+
'{0}{1}-{2}-{3}.msix',
414+
inputs.name,
415+
inputs.channel != 'production' && format('-{0}', inputs.channel) || '',
416+
inputs.version,
417+
inputs.arch
418+
) }}
419+
with:
420+
name: ${{ env.MSIX_NAME }}
421+
path: out/make/*.msix
422+
- id: upload-artifacts-zip
423+
name: 'Upload MSIX artifact'
424+
if: ${{ runner.os == 'Windows' }}
425+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
426+
env:
427+
ZIP_NAME: ${{ format(
428+
'{0}{1}-{2}-{3}.zip',
429+
inputs.name,
430+
inputs.channel != 'production' && format('-{0}', inputs.channel) || '',
431+
inputs.version,
432+
inputs.arch
433+
) }}
434+
with:
435+
name: ${{ env.ZIP_NAME }}
436+
path: out/make/*.zip

make-pear-app/upload-artifacts.cjs

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)