-
Notifications
You must be signed in to change notification settings - Fork 9
83 lines (76 loc) · 3.04 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
name: release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-20.04
env:
GOPROXY: direct
steps:
- name: install packages
run: |
sudo apt update
sudo apt -y install libayatana-appindicator3-dev libappindicator3-dev libgtk-3-dev
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19
- name: install changelog
run: |
go install evgenykuznetsov.org/go/changelog/cmd/changelog@latest
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: install fpm
run: gem install fpm
- name: build packages
run: |
git fetch --tags --force
mkdir release
changelog -n "Evgeny Kuznetsov" -e "[email protected]" -p "matebook-applet" CHANGELOG.md
VER=$(go run version_generate.go)
go build -buildmode=pie -trimpath -ldflags "-s -w -buildid= -X main.version=$VER" -tags=legacy_appindicator
tar -czf release/matebook-applet-amd64-$VER-legacy.tar.gz matebook-applet LICENSE README.md CHANGELOG.md SOURCE.txt
go build -buildmode=pie -trimpath -ldflags "-s -w -buildid= -X main.version=$VER"
tar -czf release/matebook-applet-amd64-$VER.tar.gz matebook-applet LICENSE README.md CHANGELOG.md SOURCE.txt
fpm -t deb -s dir \
-d libayatana-appindicator3-1 \
-d libc6 \
-d "libgtk-3-0 >= 3.10" \
--deb-recommends huawei-wmi \
-a amd64 \
-n matebook-applet -v $VER \
-m "Evgeny Kuznetsov <[email protected]>" \
--deb-changelog debian.changelog \
--license GPL-3 \
--deb-priority optional \
--url https://evgenykuznetsov.org/go/matebook-applet \
--category misc \
--vendor "Evgeny Kuznetsov <[email protected]>" \
--description "System tray applet for Huawei MateBook\nAllows one to control Huawei MateBook features,\nlike Fn-Lock and Battery Protection settings, via GUI." \
LICENSE=/usr/share/doc/matebook-applet/ \
README.md=/usr/share/doc/matebook-applet/ \
SOURCE.txt=/usr/share/doc/matebook-applet \
matebook-applet=/usr/bin/ \
matebook-applet.1=/usr/share/man/man1/ \
assets/matebook-applet.png=/usr/share/icons/hicolor/512x512/apps/ \
matebook-applet.desktop=/usr/share/applications/
mv *.deb release/
- name: release
uses: marvinpinto/[email protected]
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: "release/*"
- name: trigger repository update
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
script: matebook-applet