-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (71 loc) · 3.6 KB
/
main.yaml
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
name: Build and deploy
on:
push:
pull_request:
env:
source-directory: $GITHUB_WORKSPACE
build-directory: /tmp/build
ftp_server: ${{ secrets.FTP_SERVER }}
ftp_port: ${{ secrets.FTP_PORT }}
ftp_username: ${{ secrets.FTP_USERNAME }}
ftp_password: ${{ secrets.FTP_PASSWORD }}
remote_dir1: ${{ secrets.FTP_REMOTE_DIR1 }}
remote_dir2: ${{ secrets.FTP_REMOTE_DIR2 }}
remote_dir3: ${{ secrets.FTP_REMOTE_DIR3 }}
jobs:
build:
runs-on: ubuntu-22.04
name: "Build and deploy"
timeout-minutes: 8
steps:
- name: Checkout Campo
uses: actions/checkout@v4
- name: configure system
run: |
# sudo apt-get update
# sudo apt-get upgrade
# sudo apt-get autoremove
sudo apt-get --yes install lftp
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: campo_dev
environment-file: environment/configuration/campo_dev.yaml
python-version: 3.11
auto-activate-base: false
- name: Configure Campo
shell: bash -l {0}
run: |
mkdir ${{ env.build-directory }}
cmake \
-S ${{ env.source-directory }} \
-B ${{ env.build-directory }} \
-D CAMPO_BUILD_WHEEL=ON
- name: Build Campo
shell: bash -l {0}
run: |
cmake --build ${{ env.build-directory }} --target documentation
cmake --build ${{ env.build-directory }} --target install
rm -f ${{ env.build-directory }}/package/dist/*gz
- name: Test Campo
shell: bash -l {0}
run: |
ctest --test-dir ${{ env.build-directory }} --output-on-failure
- name: Deploy wheel
if: github.repository == 'computationalgeography/campo'
run: |
mkdir -p $HOME/.ssh
echo "HostKeyAlgorithms ssh-rsa" >> $HOME/.ssh/config
echo "PubkeyAcceptedKeyTypes ssh-rsa" >> $HOME/.ssh/config
echo "StrictHostKeyChecking no" >> $HOME/.ssh/config
cd ${{ env.build-directory }}
lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue package/dist/ ${{ env.remote_dir2 }}"
- name: Deploy documentation
if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master'
run: |
cd ${{ env.build-directory }}
# lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue --parallel=2 documentation/_build/ ${{ env.remote_dir1 }}"
- name: Deploy development documentation
if: github.repository == 'computationalgeography/campo'
run: |
cd ${{ env.build-directory }}
lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue --parallel=2 documentation/_build/ ${{ env.remote_dir3 }}"