-
-
Notifications
You must be signed in to change notification settings - Fork 4
724 lines (635 loc) · 31 KB
/
Copy pathrelease.yml
File metadata and controls
724 lines (635 loc) · 31 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
---
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
Release-GitHub:
runs-on: ubuntu-latest
steps:
- name: "Checkout Repo"
uses: actions/checkout@v7
- name: Create tag
if: github.ref == 'refs/heads/Mainline'
uses: rickstaa/action-create-tag@v1
with:
tag: "v${{ github.event.inputs.version }}"
- name: Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v3
with:
files: |
${{ github.workspace }}/git-credential-outlook
${{ github.workspace }}/git-credential-gmail
${{ github.workspace }}/git-credential-yahoo
${{ github.workspace }}/git-credential-aol
${{ github.workspace }}/git-msgraph
${{ github.workspace }}/git-protonmail
tag_name: "v${{ github.event.inputs.version }}"
draft: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Release-DEB:
needs: [Release-GitHub]
runs-on: ubuntu-latest
steps:
- name: "Checkout Repo"
uses: actions/checkout@v7
with:
ref: v${{ github.event.inputs.version }}
- name: Configure GPG Key
run: |
echo -n "$GPG_SIGNING_KEY" | base64 -di | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Release
id: publish
run: |
sudo apt update
sudo apt install -y wget git gpg apt-utils dpkg-dev
git checkout v${{ github.event.inputs.version }}
cd ${{ github.workspace }}
for i in git-credential-outlook git-credential-gmail git-credential-yahoo git-credential-aol git-msgraph git-protonmail
do
mkdir -p ${{ github.workspace }}/cred-$i/DEBIAN
mkdir -p ${{ github.workspace }}/cred-$i/usr/bin
cp ./$i ./cred-$i/usr/bin
done
cat <<EOF > ./cred-git-credential-outlook/DEBIAN/control
Package: git-credential-outlook
Version: ${{ github.event.inputs.version }}
Section: utils
Priority: optional
Depends: git-email, python3-keyring, python3-requests
Recommends: python3-qrcode
Suggests: python3-pyqt6.qtwebengine | python3-pyside6.qtwebenginewidgets
Enhances: git-email
Architecture: all
Maintainer: Aditya Garg <gargaditya08@live.com>
Description: Git credential helper for Microsoft Outlook accounts
EOF
cat <<EOF > ./cred-git-credential-gmail/DEBIAN/control
Package: git-credential-gmail
Version: ${{ github.event.inputs.version }}
Section: utils
Priority: optional
Depends: git-email, python3-keyring, python3-requests
Recommends: python3-qrcode
Suggests: python3-pyqt6.qtwebengine | python3-pyside6.qtwebenginewidgets
Enhances: git-email
Architecture: all
Maintainer: Aditya Garg <gargaditya08@live.com>
Description: Git credential helper for Gmail accounts
EOF
cat <<EOF > ./cred-git-credential-yahoo/DEBIAN/control
Package: git-credential-yahoo
Version: ${{ github.event.inputs.version }}
Section: utils
Priority: optional
Depends: git-email, python3-keyring, python3-requests
Recommends: python3-qrcode
Suggests: python3-pyqt6.qtwebengine | python3-pyside6.qtwebenginewidgets
Enhances: git-email
Architecture: all
Maintainer: Aditya Garg <gargaditya08@live.com>
Description: Git credential helper for Yahoo accounts
EOF
cat <<EOF > ./cred-git-credential-aol/DEBIAN/control
Package: git-credential-aol
Version: ${{ github.event.inputs.version }}
Section: utils
Priority: optional
Depends: git-email, python3-keyring, python3-requests
Recommends: python3-qrcode
Suggests: python3-pyqt6.qtwebengine | python3-pyside6.qtwebenginewidgets
Enhances: git-email
Architecture: all
Maintainer: Aditya Garg <gargaditya08@live.com>
Description: Git credential helper for AOL accounts
EOF
cat <<EOF > ./cred-git-msgraph/DEBIAN/control
Package: git-msgraph
Version: ${{ github.event.inputs.version }}
Section: utils
Priority: optional
Depends: git-email, python3-keyring, python3-requests
Recommends: python3-qrcode
Suggests: python3-pyqt6.qtwebengine | python3-pyside6.qtwebenginewidgets
Enhances: git-email
Architecture: all
Maintainer: Aditya Garg <gargaditya08@live.com>
Description: Git helper to use Microsoft Graph API instead of SMTP to send emails
EOF
cat <<EOF > ./cred-git-protonmail/DEBIAN/control
Package: git-protonmail
Version: ${{ github.event.inputs.version }}
Section: utils
Priority: optional
Depends: git-email, python3-bcrypt, python3-cryptography, python3-keyring, python3-pgpy, python3-pyasn1, python3-requests, python3-requests-toolbelt, python3-typing-extensions
Recommends: python3-pyqt6.qtwebengine | python3-pyside6.qtwebenginewidgets
Enhances: git-email
Architecture: all
Maintainer: Aditya Garg <gargaditya08@live.com>
Description: Git helper to use ProtonMail API to send emails
EOF
for i in git-credential-outlook git-credential-gmail git-credential-yahoo git-credential-aol git-msgraph git-protonmail
do
chmod a+x ./cred-$i/DEBIAN/control
chmod a+x ./cred-$i/usr/bin/$i
dpkg-deb --build --root-owner-group -Zgzip cred-$i
dpkg-name cred-$i.deb
done
gh release download debian -D debian -R AdityaGarg8/git-credential-email
mv -v ./*.deb ./debian
cd debian
dpkg-scanpackages --multiversion . > Packages
gzip -k -f Packages
apt-ftparchive release . > Release
gpg --default-key "${GPG_SIGNING_EMAIL}" -abs -o - Release > Release.gpg
gpg --default-key "${GPG_SIGNING_EMAIL}" --clearsign -o - Release > InRelease
gh release upload debian ./* --clobber -R AdityaGarg8/git-credential-email
env:
GPG_SIGNING_EMAIL: ${{ secrets.GPG_SIGNING_EMAIL }}
GH_TOKEN: ${{ secrets.PAT }}
Release-RPM:
needs: [Release-GitHub]
runs-on: ubuntu-latest
steps:
- name: "Checkout Repo"
uses: actions/checkout@v7
- name: Release
id: publish
run: |
cat <<EOF > ./rpm/git-credential-outlook.spec
Name: git-credential-outlook
Version: ${{ github.event.inputs.version }}
Release: 1%{?dist}
Summary: Git credential helper for Microsoft Outlook accounts
License: Apache-2.0
URL: https://github.com/AdityaGarg8/git-credential-email
Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz
BuildArch: noarch
Requires: git-email
%if 0%{?fedora}%{?rhel}
Requires: python-keyring
Requires: python-requests
Recommends: python-qrcode
Suggests: (python-pyqt6-webengine or python-pyside6)
%elif 0%{?suse_version}%{?sle_version}
Requires: python3-keyring
Requires: python3-requests
Recommends: python3-qrcode
Suggests: (python3-PyQt6-WebEngine or python3-pyside6)
%else
%{error: unsupported distribution}
%endif
%description
Git credential helper for Microsoft Outlook accounts.
%prep
%autosetup -n git-credential-email-${{ github.event.inputs.version }}
%build
%install
install -D -m0755 git-credential-outlook %{buildroot}%{_bindir}/git-credential-outlook
%files
%license LICENSE-APACHE NOTICE
%doc README.md
%{_bindir}/git-credential-outlook
EOF
cat <<EOF > ./rpm/git-credential-gmail.spec
Name: git-credential-gmail
Version: ${{ github.event.inputs.version }}
Release: 1%{?dist}
Summary: Git credential helper for Gmail accounts
License: Apache-2.0
URL: https://github.com/AdityaGarg8/git-credential-email
Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz
BuildArch: noarch
Requires: git-email
%if 0%{?fedora}%{?rhel}
Requires: python-keyring
Requires: python-requests
Recommends: python-qrcode
Suggests: (python-pyqt6-webengine or python-pyside6)
%elif 0%{?suse_version}%{?sle_version}
Requires: python3-keyring
Requires: python3-requests
Recommends: python3-qrcode
Suggests: (python3-PyQt6-WebEngine or python3-pyside6)
%else
%{error: unsupported distribution}
%endif
%description
Git credential helper for Gmail accounts.
%prep
%autosetup -n git-credential-email-${{ github.event.inputs.version }}
%build
%install
install -D -m0755 git-credential-gmail %{buildroot}%{_bindir}/git-credential-gmail
%files
%license LICENSE-APACHE NOTICE
%doc README.md
%{_bindir}/git-credential-gmail
EOF
cat <<EOF > ./rpm/git-credential-yahoo.spec
Name: git-credential-yahoo
Version: ${{ github.event.inputs.version }}
Release: 1%{?dist}
Summary: Git credential helper for Yahoo accounts
License: Apache-2.0
URL: https://github.com/AdityaGarg8/git-credential-email
Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz
BuildArch: noarch
Requires: git-email
%if 0%{?fedora}%{?rhel}
Requires: python-keyring
Requires: python-requests
Recommends: python-qrcode
Suggests: (python-pyqt6-webengine or python-pyside6)
%elif 0%{?suse_version}%{?sle_version}
Requires: python3-keyring
Requires: python3-requests
Recommends: python3-qrcode
Suggests: (python3-PyQt6-WebEngine or python3-pyside6)
%else
%{error: unsupported distribution}
%endif
%description
Git credential helper for Yahoo accounts.
%prep
%autosetup -n git-credential-email-${{ github.event.inputs.version }}
%build
%install
install -D -m0755 git-credential-yahoo %{buildroot}%{_bindir}/git-credential-yahoo
%files
%license LICENSE-APACHE NOTICE
%doc README.md
%{_bindir}/git-credential-yahoo
EOF
cat <<EOF > ./rpm/git-credential-aol.spec
Name: git-credential-aol
Version: ${{ github.event.inputs.version }}
Release: 1%{?dist}
Summary: Git credential helper for AOL accounts
License: Apache-2.0
URL: https://github.com/AdityaGarg8/git-credential-email
Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz
BuildArch: noarch
Requires: git-email
%if 0%{?fedora}%{?rhel}
Requires: python-keyring
Requires: python-requests
Recommends: python-qrcode
Suggests: (python-pyqt6-webengine or python-pyside6)
%elif 0%{?suse_version}%{?sle_version}
Requires: python3-keyring
Requires: python3-requests
Recommends: python3-qrcode
Suggests: (python3-PyQt6-WebEngine or python3-pyside6)
%else
%{error: unsupported distribution}
%endif
%description
Git credential helper for AOL accounts.
%prep
%autosetup -n git-credential-email-${{ github.event.inputs.version }}
%build
%install
install -D -m0755 git-credential-aol %{buildroot}%{_bindir}/git-credential-aol
%files
%license LICENSE-APACHE NOTICE
%doc README.md
%{_bindir}/git-credential-aol
EOF
cat <<EOF > ./rpm/git-msgraph.spec
Name: git-msgraph
Version: ${{ github.event.inputs.version }}
Release: 1%{?dist}
Summary: Git helper to use Microsoft Graph API instead of SMTP to send emails
License: Apache-2.0
URL: https://github.com/AdityaGarg8/git-credential-email
Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz
BuildArch: noarch
Requires: git-email
%if 0%{?fedora}%{?rhel}
Requires: python-keyring
Requires: python-requests
Recommends: python-qrcode
Suggests: (python-pyqt6-webengine or python-pyside6)
%elif 0%{?suse_version}%{?sle_version}
Requires: python3-keyring
Requires: python3-requests
Recommends: python3-qrcode
Suggests: (python3-PyQt6-WebEngine or python3-pyside6)
%else
%{error: unsupported distribution}
%endif
%description
Git helper to use Microsoft Graph API instead of SMTP to send emails
%prep
%autosetup -n git-credential-email-${{ github.event.inputs.version }}
%build
%install
install -D -m0755 git-msgraph %{buildroot}%{_bindir}/git-msgraph
%files
%license LICENSE-APACHE NOTICE
%doc README.md
%{_bindir}/git-msgraph
EOF
cat <<EOF > ./rpm/git-protonmail.spec
Name: git-protonmail
Version: ${{ github.event.inputs.version }}
Release: 1%{?dist}
Summary: Git helper to use ProtonMail API to send emails
License: GPL-3.0-only
URL: https://github.com/AdityaGarg8/git-credential-email
Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz
BuildArch: noarch
Requires: git-email
%if 0%{?fedora}%{?rhel}
Requires: python-bcrypt
Requires: python-cryptography
Requires: python-keyring
Requires: python-pgpy
Requires: python-pyasn1
Requires: python-requests
Requires: python-requests-toolbelt
Requires: python-typing-extensions
Recommends: (python-pyqt6-webengine or python-pyside6)
%elif 0%{?suse_version}%{?sle_version}
Requires: python3-bcrypt
Requires: python3-cryptography
Requires: python3-keyring
Requires: python3-pgpy
Requires: python3-pyasn1
Requires: python3-requests
Requires: python3-requests-toolbelt
Requires: python3-typing-extensions
Recommends: (python3-PyQt6-WebEngine or python3-pyside6)
%else
%{error: unsupported distribution}
%endif
%description
Git helper to use ProtonMail API to send emails
%prep
%autosetup -n git-credential-email-${{ github.event.inputs.version }}
%build
%install
install -D -m0755 git-protonmail %{buildroot}%{_bindir}/git-protonmail
%files
%license LICENSE-GPL3
%doc README.md
%{_bindir}/git-protonmail
EOF
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add .
git commit -m "Update RPM packages to ${{ github.event.inputs.version }}" || true
- name: Push changes to the repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: "Trigger COPR webhook"
run: |
for i in git-credential-outlook git-credential-gmail git-credential-yahoo git-credential-aol git-msgraph git-protonmail
do
curl -sS -X POST $COPR_WEBHOOK/$i
done
env:
COPR_WEBHOOK: ${{ secrets.COPR_WEBHOOK }}
Release-Archlinux:
needs: [Release-GitHub]
runs-on: ubuntu-latest
steps:
- name: "Checkout Repo"
uses: actions/checkout@v7
with:
ref: v${{ github.event.inputs.version }}
- name: Release
id: publish
run: |
echo -n "$GPG_SIGNING_KEY" | base64 -di > key
docker pull archlinux:latest
docker run \
-e GPG_SIGNING_EMAIL=${{ secrets.GPG_SIGNING_EMAIL }} \
-e GH_TOKEN=${{ secrets.PAT }} \
-e VER=${{ github.event.inputs.version }} \
-t \
-v "$(pwd)":/repo \
archlinux:latest \
/bin/bash -c 'pacman -Syu --noconfirm --needed sudo git base-devel wget github-cli && \
mkdir /build && \
mkdir /release && \
useradd builduser -m && chown -R builduser:builduser /build && passwd -d builduser && \
printf "builduser ALL=(ALL) ALL\n" | tee -a /etc/sudoers && \
cp -r /repo/* /build && cat /repo/key | gpg --import && \
cd /build && \
echo "pkgname=git-credential-outlook" > PKGBUILD && \
echo "pkgver=${VER}" >> PKGBUILD && \
echo "pkgrel=1" >> PKGBUILD && \
echo "pkgdesc=\"Git credential helper for Microsoft Outlook accounts\"" >> PKGBUILD && \
echo "arch=(\"any\")" >> PKGBUILD && \
echo "url=\"https://github.com/AdityaGarg8/git-credential-email\"" >> PKGBUILD && \
echo "license=(\"Apache-2.0\")" >> PKGBUILD && \
echo "depends=(\"git\" \"perl-authen-sasl\" \"perl-io-socket-ssl\" \"python-keyring\" \"python-requests\")" >> PKGBUILD && \
echo "optdepends=(\"python-pyqt6-webengine: For easier OAuth2 flow\" \"python-qrcode: To generate QR codes of important URLs\")" >> PKGBUILD && \
echo "source=(\"\$pkgname\")" >> PKGBUILD && \
echo "sha256sums=(\"SKIP\")" >> PKGBUILD && \
echo "package() {" >> PKGBUILD && \
echo " install -Dm755 \"\$srcdir/\$pkgname\" \"\$pkgdir/usr/bin/\$pkgname\"" >> PKGBUILD && \
echo "}" >> PKGBUILD && \
sudo -u builduser makepkg --nodeps && \
echo "pkgname=git-credential-gmail" > PKGBUILD && \
echo "pkgver=${VER}" >> PKGBUILD && \
echo "pkgrel=1" >> PKGBUILD && \
echo "pkgdesc=\"Git credential helper for Gmail accounts\"" >> PKGBUILD && \
echo "arch=(\"any\")" >> PKGBUILD && \
echo "url=\"https://github.com/AdityaGarg8/git-credential-email\"" >> PKGBUILD && \
echo "license=(\"Apache-2.0\")" >> PKGBUILD && \
echo "depends=(\"git\" \"perl-authen-sasl\" \"perl-io-socket-ssl\" \"python-keyring\" \"python-requests\")" >> PKGBUILD && \
echo "optdepends=(\"python-pyqt6-webengine: For easier OAuth2 flow\" \"python-qrcode: To generate QR codes of important URLs\")" >> PKGBUILD && \
echo "source=(\"\$pkgname\")" >> PKGBUILD && \
echo "sha256sums=(\"SKIP\")" >> PKGBUILD && \
echo "package() {" >> PKGBUILD && \
echo " install -Dm755 \"\$srcdir/\$pkgname\" \"\$pkgdir/usr/bin/\$pkgname\"" >> PKGBUILD && \
echo "}" >> PKGBUILD && \
sudo -u builduser makepkg --nodeps && \
echo "pkgname=git-credential-yahoo" > PKGBUILD && \
echo "pkgver=${VER}" >> PKGBUILD && \
echo "pkgrel=1" >> PKGBUILD && \
echo "pkgdesc=\"Git credential helper for Yahoo accounts\"" >> PKGBUILD && \
echo "arch=(\"any\")" >> PKGBUILD && \
echo "url=\"https://github.com/AdityaGarg8/git-credential-email\"" >> PKGBUILD && \
echo "license=(\"Apache-2.0\")" >> PKGBUILD && \
echo "depends=(\"git\" \"perl-authen-sasl\" \"perl-io-socket-ssl\" \"python-keyring\" \"python-requests\")" >> PKGBUILD && \
echo "optdepends=(\"python-pyqt6-webengine: For easier OAuth2 flow\" \"python-qrcode: To generate QR codes of important URLs\")" >> PKGBUILD && \
echo "source=(\"\$pkgname\")" >> PKGBUILD && \
echo "sha256sums=(\"SKIP\")" >> PKGBUILD && \
echo "package() {" >> PKGBUILD && \
echo " install -Dm755 \"\$srcdir/\$pkgname\" \"\$pkgdir/usr/bin/\$pkgname\"" >> PKGBUILD && \
echo "}" >> PKGBUILD && \
sudo -u builduser makepkg --nodeps && \
echo "pkgname=git-credential-aol" > PKGBUILD && \
echo "pkgver=${VER}" >> PKGBUILD && \
echo "pkgrel=1" >> PKGBUILD && \
echo "pkgdesc=\"Git credential helper for AOL accounts\"" >> PKGBUILD && \
echo "arch=(\"any\")" >> PKGBUILD && \
echo "url=\"https://github.com/AdityaGarg8/git-credential-email\"" >> PKGBUILD && \
echo "license=(\"Apache-2.0\")" >> PKGBUILD && \
echo "depends=(\"git\" \"perl-authen-sasl\" \"perl-io-socket-ssl\" \"python-keyring\" \"python-requests\")" >> PKGBUILD && \
echo "optdepends=(\"python-pyqt6-webengine: For easier OAuth2 flow\" \"python-qrcode: To generate QR codes of important URLs\")" >> PKGBUILD && \
echo "source=(\"\$pkgname\")" >> PKGBUILD && \
echo "sha256sums=(\"SKIP\")" >> PKGBUILD && \
echo "package() {" >> PKGBUILD && \
echo " install -Dm755 \"\$srcdir/\$pkgname\" \"\$pkgdir/usr/bin/\$pkgname\"" >> PKGBUILD && \
echo "}" >> PKGBUILD && \
sudo -u builduser makepkg --nodeps && \
echo "pkgname=git-msgraph" > PKGBUILD && \
echo "pkgver=${VER}" >> PKGBUILD && \
echo "pkgrel=1" >> PKGBUILD && \
echo "pkgdesc=\"Git helper to use Microsoft Graph API instead of SMTP to send emails\"" >> PKGBUILD && \
echo "arch=(\"any\")" >> PKGBUILD && \
echo "url=\"https://github.com/AdityaGarg8/git-credential-email\"" >> PKGBUILD && \
echo "license=(\"Apache-2.0\")" >> PKGBUILD && \
echo "depends=(\"git\" \"perl-authen-sasl\" \"perl-io-socket-ssl\" \"python-keyring\" \"python-requests\")" >> PKGBUILD && \
echo "optdepends=(\"python-pyqt6-webengine: For easier OAuth2 flow\" \"python-qrcode: To generate QR codes of important URLs\")" >> PKGBUILD && \
echo "source=(\"\$pkgname\")" >> PKGBUILD && \
echo "sha256sums=(\"SKIP\")" >> PKGBUILD && \
echo "package() {" >> PKGBUILD && \
echo " install -Dm755 \"\$srcdir/\$pkgname\" \"\$pkgdir/usr/bin/\$pkgname\"" >> PKGBUILD && \
echo "}" >> PKGBUILD && \
sudo -u builduser makepkg --nodeps && \
echo "pkgname=git-protonmail" > PKGBUILD && \
echo "pkgver=${VER}" >> PKGBUILD && \
echo "pkgrel=1" >> PKGBUILD && \
echo "pkgdesc=\"Git helper to use ProtonMail API to send emails\"" >> PKGBUILD && \
echo "arch=(\"any\")" >> PKGBUILD && \
echo "url=\"https://github.com/AdityaGarg8/git-credential-email\"" >> PKGBUILD && \
echo "license=(\"GPL-3.0-only\")" >> PKGBUILD && \
echo "depends=(\"git\" \"perl-authen-sasl\" \"perl-io-socket-ssl\" \"python-bcrypt\" \"python-cryptography\" \"python-keyring\" \"python-pgpy\" \"python-pyasn1\" \"python-requests\" \"python-requests-toolbelt\" \"python-typing_extensions\")" >> PKGBUILD && \
echo "optdepends=(\"python-pyqt6-webengine: For easier manual CAPTCHA solving\")" >> PKGBUILD && \
echo "source=(\"\$pkgname\")" >> PKGBUILD && \
echo "sha256sums=(\"SKIP\")" >> PKGBUILD && \
echo "package() {" >> PKGBUILD && \
echo " install -Dm755 \"\$srcdir/\$pkgname\" \"\$pkgdir/usr/bin/\$pkgname\"" >> PKGBUILD && \
echo "}" >> PKGBUILD && \
sudo -u builduser makepkg --nodeps && \
cp -v ./*pkg.tar.zst /release && \
cd /release && \
gpg --detach-sign --use-agent --yes git-credential-outlook*pkg.tar.zst && \
gpg --detach-sign --use-agent --yes git-credential-gmail*pkg.tar.zst && \
gpg --detach-sign --use-agent --yes git-credential-yahoo*pkg.tar.zst && \
gpg --detach-sign --use-agent --yes git-credential-aol*pkg.tar.zst && \
gpg --detach-sign --use-agent --yes git-msgraph*pkg.tar.zst && \
gpg --detach-sign --use-agent --yes git-protonmail*pkg.tar.zst && \
repo-add git-credential-email.db.tar.gz *pkg.tar.zst --sign && cd / && \
gh release download archlinux -D archlinux -R AdityaGarg8/git-credential-email && \
cp -v /release/* ./archlinux && cd ./archlinux && \
gh release upload archlinux ./* --clobber -R AdityaGarg8/git-credential-email'
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
Release-Homebrew:
needs: [Release-GitHub]
runs-on: ubuntu-latest
steps:
- name: "Checkout Repo"
uses: actions/checkout@v7
- name: Get SHA256SUM
id: compute_sha
run: |
wget https://github.com/AdityaGarg8/git-credential-email/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz
SHASUM=$(sha256sum ./v${{ github.event.inputs.version }}.tar.gz | cut -d " " -f 1 | xargs)
echo "sha=$SHASUM" >> $GITHUB_ENV
- name: Release
id: publish
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git clone https://github.com/AdityaGarg8/homebrew-git-credential-email
cd homebrew-git-credential-email
sed -i -E \
-e 's|url "https://github.com/AdityaGarg8/git-credential-email/archive/refs/tags/v[0-9]+(\.[0-9]+)+\.tar\.gz"|url "https://github.com/AdityaGarg8/git-credential-email/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz"|' \
-e '0,/sha256 "[a-f0-9]{64}"/s//sha256 "${{ env.sha }}"/' \
git-credential-outlook.rb git-credential-gmail.rb git-credential-yahoo.rb git-credential-aol.rb git-msgraph.rb git-protonmail.rb
cd ..
- name: Publish to repo
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.PAT }}
with:
source-directory: 'homebrew-git-credential-email'
destination-github-username: 'AdityaGarg8'
destination-repository-name: 'homebrew-git-credential-email'
user-email: github-actions[bot]@users.noreply.github.com
user-name: github-actions[bot]
target-branch: main
commit-message: Update credential helpers to v${{ github.event.inputs.version }}
Release-Windows:
needs: [Release-GitHub]
runs-on: windows-latest
steps:
- name: "Checkout Repo"
uses: actions/checkout@v7
- name: Release
id: publish
run: |
New-Item -ItemType Directory -Path outlook
New-Item -ItemType Directory -Path gmail
New-Item -ItemType Directory -Path yahoo
New-Item -ItemType Directory -Path aol
New-Item -ItemType Directory -Path msgraph
New-Item -ItemType Directory -Path protonmail
New-Item -ItemType Directory -Path protonmail_lite
pip install pyinstaller keyring requests qrcode
Copy-Item -Path .\git-credential-outlook -Destination .\outlook
Copy-Item -Path .\git-credential-gmail -Destination .\gmail
Copy-Item -Path .\git-credential-yahoo -Destination .\yahoo
Copy-Item -Path .\git-credential-aol -Destination .\aol
Copy-Item -Path .\git-msgraph -Destination .\msgraph
Copy-Item -Path .\git-protonmail -Destination .\protonmail
Copy-Item -Path .\git-protonmail -Destination .\protonmail_lite
cd outlook
pyinstaller git-credential-outlook --exclude-module PyQt6 --exclude-module PySide6 --icon=NONE --contents-directory gco-resources
cd ..
cd gmail
pyinstaller git-credential-gmail --exclude-module PyQt6 --exclude-module PySide6 --icon=NONE --contents-directory gcg-resources
cd ..
cd yahoo
pyinstaller git-credential-yahoo --exclude-module PyQt6 --exclude-module PySide6 --icon=NONE --contents-directory gcy-resources
cd ..
cd aol
pyinstaller git-credential-aol --exclude-module PyQt6 --exclude-module PySide6 --icon=NONE --contents-directory gca-resources
cd ..
cd msgraph
pyinstaller git-msgraph --exclude-module PyQt6 --exclude-module PySide6 --icon=NONE --contents-directory gcm-resources
cd ..
pip install bcrypt cryptography keyring PGPy13 requests requests-toolbelt typing-extensions
cd protonmail_lite
pyinstaller git-protonmail --exclude-module PyQt6 --exclude-module PySide6 --icon=NONE --contents-directory gcpl-resources
cd ..
pip install PyQt6-WebEngine
cd protonmail
pyinstaller git-protonmail --exclude-module PySide6 --icon=NONE --contents-directory gcp-resources
cd ..
Compress-Archive -Path .\outlook\dist\git-credential-outlook\* -DestinationPath git-credential-outlook_win64.zip
Compress-Archive -Path .\gmail\dist\git-credential-gmail\* -DestinationPath git-credential-gmail_win64.zip
Compress-Archive -Path .\yahoo\dist\git-credential-yahoo\* -DestinationPath git-credential-yahoo_win64.zip
Compress-Archive -Path .\aol\dist\git-credential-aol\* -DestinationPath git-credential-aol_win64.zip
Compress-Archive -Path .\msgraph\dist\git-msgraph\* -DestinationPath git-msgraph_win64.zip
Compress-Archive -Path .\protonmail\dist\git-protonmail\* -DestinationPath git-protonmail_win64.zip
Compress-Archive -Path .\protonmail_lite\dist\git-protonmail\* -DestinationPath git-protonmail_lite_win64.zip
- name: Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v3
with:
files: |
${{ github.workspace }}/*.zip
tag_name: "v${{ github.event.inputs.version }}"
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}