-
Notifications
You must be signed in to change notification settings - Fork 17
executable file
·96 lines (88 loc) · 2.61 KB
/
release.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
name: Release
on:
release:
types: [released]
permissions: {}
defaults:
run:
shell: bash
jobs:
generate_zip:
name: Generate release zip
runs-on: [ubuntu-latest]
timeout-minutes: 60
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
clean: true
- name: Zip release file
run: |
sudo apt-get update || exit 1
sudo apt-get install zip || exit 1
echo "show runner hostname"
hostname
echo "show runner user"
whoami
echo "show runner pwd"
pwd
echo "show runner kernel"
uname -a
echo "show runner pwd file list"
ls
ls -alht "custom_components/midea_ac_lan/" || exit 1
echo "show manifest.json for debug"
cat "custom_components/midea_ac_lan/manifest.json" || exit 1
dst_dir="/github/workspace/artifacts"
sudo mkdir -p "$dst_dir" || exit 1
sudo chown -R "$(id -u):$(id -g)" "$dst_dir" || exit 1
sudo chmod -R 755 "$dst_dir" || exit 1
cd "custom_components/midea_ac_lan/" || exit 1
zip -r ../midea_ac_lan.zip ./* || exit 1
cp ../midea_ac_lan.zip "$dst_dir/" || exit 1
ls -alht "$dst_dir" || exit 1
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: midea_ac_lan.zip
path: /github/workspace/artifacts
upload_release:
needs: generate_zip
name: Publish release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: midea_ac_lan.zip
merge-multiple: true
- name: Display Structure of Artifacts Files
run: ls -R
- name: Show Working Directory For Debug Purpose
run: |
echo "show runner hostname"
hostname
echo "show runner user"
whoami
echo "show runner disk usage"
df -h
echo "show runner pwd"
pwd
echo "show runner kernel"
uname -a
echo "show runner pwd file list"
ls
ls -alht
echo "show runner artifacts"
ls -alht artifacts || exit 0
echo "github.ref: ${{github.ref}}"
- name: Upload images to Release Asset
uses: softprops/action-gh-release@v2
with:
files: artifacts/midea_ac_lan.zip
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}