-
-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (61 loc) · 2.17 KB
/
indimail-mta-obs.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
name: indimail-mta obs trigger
on:
push:
paths:
- '**/indimail-mta-x/**'
- '**/prepare_obs'
- '**/catChangeLog'
- .github/workflows/indimail-mta-obs.yml
- '!**/indimail-mta-x/qmail-perf/*'
- '!**/indimail-mta-x/tests/*'
- '!**/doc/*'
- '!**.md'
- '!**/*.freebsd.yml'
- '!**/*.c-cpp.yml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout_indimail-mta
uses: actions/checkout@v4
- name: checkout_qmail
uses: actions/checkout@v4
with:
repository: mbhangui/libqmail
path: libqmail
- name: install_qmail
run: |
sudo apt-get update; sudo apt-get install libssl-dev libmysqlclient-dev
cd libqmail; ./default.configure; make; sudo make install-strip
- name: prepare obs
run: cd indimail-mta-x; ./prepare_obs indimail-mta
- uses: actions/upload-artifact@v4
with:
name: indimail-mta
path: ~/stage
- shell: bash
name: trigger_obs
run: |
# create ssh environment
mkdir ~/.ssh
echo "${{secrets.sf_private_key}}" > ~/.private_key
chmod 600 ~/.private_key
echo "${{secrets.sf_known_hosts}}" > ~/.ssh/known_hosts
# create gpg environment
echo "Importing gpg key"
echo "${{secrets.software_key}}" | gpg --batch --import
echo "Listing gpg key"
gpg --list-secret-keys --keyid-format LONG
# create archive and transfer
cd ~/stage
tar cvfz $GITHUB_WORKSPACE/indimail-mta-obs.tar.gz *
# create detached signature for obs archive
echo "${{secrets.software_passphrase}}" | gpg2 --pinentry-mode loopback \
--passphrase-fd 0 --default-key "${{secrets.software_user}}" \
-o indimail-mta-obs.sig --detach-sig $GITHUB_WORKSPACE/indimail-mta-obs.tar.gz
# copy to /home/frs/project/indimail/github
scp -q -i ~/.private_key $GITHUB_WORKSPACE/indimail-mta-obs.tar.gz \
~/stage/indimail-mta-obs.sig "${{secrets.sf_user}}:${{secrets.sf_upload_path}}"
rm -f ~/.private_key ~/.ssh/known_hosts $GITHUB_WORKSPACE/indimail-mta-obs.tar.gz
rm -rf ~/stage