-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.42 KB
/
Copy pathdeploy.yml
File metadata and controls
60 lines (51 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Deploy
on:
workflow_call:
inputs:
app-version:
required: true
type: string
distribution-channel:
required: true
type: string
permissions:
contents: write
defaults:
run:
shell: "bash"
env:
NODE_NO_WARNINGS: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
npm_config_audit: false
npm_config_fund: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.distribution-channel }}
url: https://github.com{{ github.repository }}/releases/tag/v${{ inputs.app-version }}
steps:
- name: Download compiled app
uses: actions/download-artifact@v8
with:
pattern: "*-${{ inputs.distribution-channel }}"
path: dist
merge-multiple: true
- name: List downloaded files (Before)
run: ls -la dist/
- name: Compress directories to zip
run: |
for item in dist/*; do
if [ -d "$item" ]; then
dir_name=$(basename "$item")
echo "Compressing $dir_name to $dir_name.zip..."
7z a -tzip "dist/$dir_name.zip" "$item"
rm -rf "$item"
fi
done
- name: List final release assets (After)
run: ls -la dist/
- name: Create Release
run: gh release create v${{ inputs.app-version }} dist/* --repo ${{ github.repository }}
env:
GH_TOKEN: ${{ github.token }}