-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (92 loc) · 3.95 KB
/
main.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
name: Yusufreis CI
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Debian Package
id: build_package
run: |
sudo apt-get update
sudo apt install python3-gi
sudo apt install python3-pil
mkdir -p packages/DEBIAN
mkdir -p packages/usr/local/bin/
mkdir -p packages/usr/share/hvl/yusufreis/
echo ::set-output name=tag::${GITHUB_REF#refs/*/}
echo """#!/bin/bash
python3 /usr/share/hvl/yusufreis/src/tray.py""" > packages/usr/local/bin/yusufreis
cp -r images locale src apps.gsettings-yusufreis.gschema.xml packages/usr/share/hvl/yusufreis
mkdir -p packages/usr/share/applications/
cp -r src/yusufreis.desktop packages/usr/share/applications/yusufreis.desktop
mkdir -p packages/usr/share/hvl/yusufreis/logs
chmod o+w packages/usr/share/hvl/yusufreis/logs
size=$(du -s ./ | cut -f 1)
v=$(date +'%Y%m%d-%H%M%S')
version=${{ steps.build_package.outputs.tag }}"-"$v
date=$(date +'%d/%m/%Y-%H:%M:%S')
echo """Package: yusufreis
Version: $v
Installed-Size: $size
Maintainer: Ridvan Tulemen <ridvantulemen@gmail.com>
Date : $date
Depends: python3-pil, python3-gi
Architecture: amd64
Description: yusufreis
""" > packages/DEBIAN/control
echo """ echo \"\"\"#!/usr/bin/env xdg-open
[Desktop Entry]
Version=0.1
Type=Application
Terminal=false
Exec=/usr/local/bin/yusufreis
Name=YusufReis
Comment=YusufReis
Icon=/usr/share/hvl/yusufreis/images/Computer.png\"\"\" > /usr/share/applications/yusufreis.desktop""" >> packages/DEBIAN/postinst
find ./ -type f ! -regex '.*?DEBIAN.*' -exec md5sum {} \; > packages/DEBIAN/md5sums
echo """chmod +x /usr/local/bin/yusufreis
cp /usr/share/hvl/yusufreis/apps.gsettings-yusufreis.gschema.xml /usr/share/glib-2.0/schemas/
glib-compile-schemas /usr/share/glib-2.0/schemas/
mkdir -p '/usr/share/hvl/yusufreis/ss/'
touch /usr/share/hvl/yusufreis/logs/yusufreis.log
chmod o+w /usr/share/hvl/yusufreis/logs/yusufreis.log
touch /usr/share/hvl/yusufreis/ss/main.json
chmod o+w /usr/share/hvl/yusufreis/ss/main.json
mkdir -p /etc/skel/.config/autostart/
cp /usr/share/applications/yusufreis.desktop /etc/skel/.config/autostart/yusufreis.desktop
for homedir in /home/*; do sudo mkdir -p "\$homedir/.config/autostart/"; done
for homedir in /home/*; do sudo cp /usr/share/applications/yusufreis.desktop "\$homedir/.config/autostart/yusufreis.desktop"; done
chmod o+w -R /usr/share/hvl/yusufreis/ss/" > packages/DEBIAN/postinst
chmod +x packages/DEBIAN/postinst
version=$(date +'%Y%m%d-%H%M%S')
dpkg-deb -Zgzip --build ./packages yusufreis_$version.deb
echo ::set-output name=path::$(pwd)/yusufreis_$version.deb
echo ::set-output name=filename::yusufreis_$version.deb
echo ::set-output name=version::$version
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: yusufreis_${{ steps.build_package.outputs.version }}
release_name: Yusufreis Release ${{ steps.build_package.outputs.version }}
body: |
Changes in this Release
- First Change
draft: false
prerelease: false
- name: Upload Release
id: upload_release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.build_package.outputs.path }}
asset_name: ${{ steps.build_package.outputs.filename }}
asset_content_type: application/vnd.debian.binary_package