-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (45 loc) · 1.38 KB
/
github_actions.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
name: Package autoscripts
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
tar_directories:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Tgz directories
run: |
for dir in ./src/*; do
echo $dir
if [ -d "$dir" ]; then
pkgname=$(basename $dir)
tar -czvf ./packages/${pkgname}.tgz $dir
fi
done
- name: Generate manifest
run: |
echo "[" > manifest
for dir in src/*; do
if [ -d $dir ]; then
cd "$dir"
name=$(jq -r '.name' manifest.json)
version_major=$(jq -r '.version_major' manifest.json)
version_minor=$(jq -r '.version_minor' manifest.json)
description=$(jq -r '.description' manifest.json)
echo "{\"name\":\"$name\",\"version_major\":\"$version_major\",\"version_minor\":\"$version_minor\",\"description\":\"$description\"}," >> ../../manifest
cd ../..
fi
done
sed -i '$ s/.$//' manifest
echo "]" >> manifest
- name: Commit autoscripts packages
uses: EndBug/add-and-commit@v9
with:
add: './packages/*.tgz' 'manifest'
author_name: Eggheads Autoscripts
author_email: [email protected]
default_author: user_info
message: Update autoscripts
push: true