@@ -15,21 +15,35 @@ jobs:
15
15
include :
16
16
- target : x86_64-unknown-linux-gnu
17
17
os : ubuntu-latest
18
+ container : ' archlinux'
19
+ format : pacman
20
+ - target : x86_64-unknown-linux-gnu
21
+ os : ubuntu-latest
22
+ container : ' '
23
+ format : deb
18
24
- target : x86_64-apple-darwin
19
25
os : macos-latest
26
+ format : dmg
20
27
- target : x86_64-pc-windows-msvc
21
28
os : windows-latest
29
+ format : wix
22
30
runs-on : ${{ matrix.os }}
31
+ container : ${{ matrix.container }}
23
32
steps :
24
33
- name : Checkout
25
34
uses : actions/checkout@v4
26
35
27
- - name : Setup Linux
28
- if : matrix.os == 'ubuntu-latest'
36
+ - name : Setup apt Packages
37
+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.container == '' }}
29
38
uses : awalsh128/cache-apt-pkgs-action@latest
30
39
with :
31
40
packages : libgtk-3-dev libxdo-dev libayatana-appindicator3-dev libxcb1 libxrandr2 libdbus-1-3
32
41
version : 1.0
42
+
43
+ - name : Setup pacman Packages
44
+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.container == 'archlinux' }}
45
+ run : |
46
+ pacman -Syyu gtk3 xdotool libayatana-appindicator libxcb libxrandr dbus -y
33
47
34
48
- name : Setup Windows
35
49
if : matrix.os == 'windows-latest'
@@ -56,36 +70,45 @@ jobs:
56
70
57
71
- name : Package binary
58
72
run : |
59
- cargo packager --release -v
73
+ cargo packager --release --formats ${{ matrix.format }} - v
60
74
61
- - name : Upload windows artifacts
75
+ - name : Upload .msi to artifacts
62
76
uses : actions/upload-artifact@v4
63
77
if : matrix.os == 'windows-latest'
64
78
with :
65
- name : windows_packages
79
+ name : msi
66
80
path : |
67
81
target/packages/*.msi
68
- target/packages/*.exe
69
82
70
- - name : Upload linux artifacts
83
+ - name : Upload .deb to artifacts
71
84
uses : actions/upload-artifact@v4
72
- if : matrix.os == 'ubuntu-latest'
85
+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.container == '' }}
73
86
with :
74
- name : linux_packages
87
+ name : deb
75
88
path : |
76
89
target/packages/*.deb
77
90
78
- - name : Upload macos artifacts
91
+ - name : Upload .tar.gz to artifacts
92
+ uses : actions/upload-artifact@v4
93
+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.container == 'archlinux' }}
94
+ with :
95
+ name : tar
96
+ path : |
97
+ target/packages/*.tar.gz
98
+ target/packages/PKGBUILD
99
+
100
+ - name : Upload .dmg to artifacts
79
101
uses : actions/upload-artifact@v4
80
102
if : matrix.os == 'macos-latest'
81
103
with :
82
- name : macos_packages
104
+ name : dmg
83
105
path : |
84
106
target/packages/*.dmg
85
107
86
- upload-assets :
108
+ after-build-job :
87
109
needs : build-assets
88
110
runs-on : ' ubuntu-latest'
111
+ container : ' archlinux'
89
112
steps :
90
113
- name : Checkout
91
114
uses : actions/checkout@v4
@@ -107,8 +130,26 @@ jobs:
107
130
body : |
108
131
${{ steps.changelog.outputs.changes }}
109
132
files : |
110
- windows_packages/*
111
- linux_packages/*
112
- macos_packages/*
133
+ msi/*
134
+ deb/*
135
+ tar/*.tar.gz
136
+ dmg/*
113
137
draft : false
114
- prerelease : false
138
+ prerelease : false
139
+
140
+ - name : Update PKGBUILD and .SRCINFO
141
+ run : |
142
+ mkdir -p ~/.ssh
143
+ echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
144
+ chmod 600 ~/.ssh/aur
145
+ echo -e "Host aur.archlinux.org\n IdentityFile ~/.ssh/aur\n User aur\n StrictHostKeyChecking=no" > ~/.ssh/config
146
+ git config --global user.name "${{ secrets.AUR_USERNAME }}"
147
+ git config --global user.email "${{ secrets.AUR_EMAIL }}"
148
+ git clone ssh://[email protected] /capter.git
149
+ cp -rf tar/PKGBUILD capter/PKGBUILD
150
+ cd capter
151
+ rm .SRCINFO
152
+ makepkg --nodeps --nobuild --printsrcinfo > .SRCINFO
153
+ git add PKGBUILD .SRCINFO
154
+ git commit -m "Update: ${{ github.ref_name }}" || echo "No changes !!"
155
+ git push --force
0 commit comments