-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (103 loc) · 3.23 KB
/
shells_build.yaml
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
97
98
99
100
101
102
103
104
105
name: shells_build
on:
workflow_dispatch:
# schedule:
# - cron: '30 6 1 * *'
jobs:
prepare_release:
runs-on: ubuntu-20.04
steps:
-
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
-
id: time
uses: nanzm/[email protected]
with:
format: 'YYYYMMDDHHmm'
-
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.time.outputs.time }}
release_name: Release ${{ steps.time.outputs.time }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
release_id: ${{ steps.release.outputs.id }}
release:
runs-on: ubuntu-20.04
needs: prepare_release
strategy:
matrix:
##### EDIT ME #####
EDITION: [manjaro-desktop,manjaro-kde-desktop,manjaro-gnome-desktop]
###################
steps:
-
name: Install build-dependencies
run: |
sudo apt-get update
sudo apt-get install php qemu-utils parted
-
name: Install Linux Scripts
run: |
sudo git clone https://github.com/Shells-com/linux-scripts.git
cd linux-scripts
sudo chmod +x *.sh
-
name: Build Shell Images
env:
EDITION: ${{ matrix.EDITION }}
run: |
sudo modprobe nbd
cd linux-scripts
sudo ./build_image.sh $EDITION
-
id: time
uses: nanzm/[email protected]
with:
format: 'YYYYMMDD'
-
name: Postprocess Shell Images
env:
EDITION: ${{ matrix.EDITION }}
VERSION: ${{ steps.time.outputs.time }}
run: |
FILE_PATH=$(find ./ -type f -name "*.shells" -exec stat -c '%Y %n' {} \; | sort -nr | awk 'NR==1 {print $2}')
mv $FILE_PATH ./$(basename $FILE_PATH)
sha256sum $(basename $FILE_PATH) > $(basename $FILE_PATH).sha256
echo "FILE_PATH=$(basename $FILE_PATH)" >> $GITHUB_ENV
echo "FILE_SHA256=$(basename $FILE_PATH).sha256" >> $GITHUB_ENV
-
id: upload_release_zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare_release.outputs.upload_url }}
asset_path: ./${{ env.FILE_PATH }}.shells
asset_name: ${{ env.FILE_PATH }}.shells
asset_content_type: application/x-xz
-
id: upload_sha256
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare_release.outputs.upload_url }}
asset_path: ./${{ env.FILE_SHA256 }}
asset_name: ${{ env.FILE_SHA256 }}
asset_content_type: text/plain
-
name: rollback_release
if: failure()
uses: author/action-rollback@stable
with:
release_id: ${{ needs.prepare_release.outputs.release_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}