summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 69ba56c68de256f0cc532727091fe65ec47b18f5 (plain) (blame)
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
stages:
  - build
  - deploy

# x86_64 AppImage build
x86_64-AppImage:
  image: ubuntu:trusty
  stage: build
  tags:
    - gtmw
  before_script:
    - apt-get update -qq
    - chmod +x install_dependencies.sh
    - ./install_dependencies.sh
  script:
    - cd ${CI_PROJECT_DIR}
    - ls
    - chmod +x build_appimg.sh
    - chmod +x linuxdeploy-x86_64.AppImage
    - ./linuxdeploy-x86_64.AppImage --appimage-extract
    - ./build_appimg.sh
    - mv ManaPlus-*-x86_64.AppImage ManaPlus-x86_64.AppImage
    - sha256sum ManaPlus-x86_64.AppImage > x86_64-sha256checksum.txt
    - cd
    - find / -type f -name "*.AppImage"
  artifacts:
    paths:
      - "ManaPlus-x86_64.AppImage"
      - "x86_64-sha256checksum.txt"
    expire_in: 1 week

# i386 AppImage buid
.i386-AppImage:
  image: i386/ubuntu:trusty
  stage: build
  tags:
    - gtmw
  before_script:
    - apt-get update -qq
    - chmod +x install_dependencies.sh
    - ./install_dependencies.sh
  script:
    - cd ${CI_PROJECT_DIR}
    - ls
    - chmod +x build_appimg.sh
    - chmod +x linuxdeploy-i386.AppImage
    - ./linuxdeploy-i386.AppImage --appimage-extract
    - ./build_appimg.sh
    - mv ManaPlus-*-i386.AppImage ManaPlus-i386.AppImage
    - sha256sum ManaPlus-i386.AppImage > i386-sha256checksum.txt
    - cd
    - find / -type f -name "*.AppImage"
  artifacts:
    paths:
      - "ManaPlus-i386.AppImage"
      - "i386-sha256checksum.txt"
    expire_in: 1 week

deb_pkg:
  image: ubuntu:trusty
  stage: build
  tags:
    - gtmw
  before_script:
    - apt-get update -qq
    - chmod +x install_dependencies.sh
    - ./install_dependencies.sh
  script:
    - cd ${CI_PROJECT_DIR}
    - git clone https://git.themanaworld.org/mana/plus.git manaplus
    - cd manaplus
    - cp -r packaging/debian .
    - cd debian
    - ../build/bdeb.sh
    - cd ../../
    - mv manaplus_*_amd64.deb manaplus_latest_amd64.deb
    - mv manaplus-data_*_all.deb manaplus-data_latest_all.deb
    - mv manaplus-dbg_*_amd64.deb manaplus-dbg_latest_amd64.deb
    - sha256sum manaplus_latest_amd64.deb > deb-sha256checksum.txt
    - sha256sum manaplus-data_latest_all.deb >> deb-sha256checksum.txt
    - sha256sum manaplus-dbg_latest_amd64.deb >> deb-sha256checksum.txt
    - find / -type f -name "*.deb"
  artifacts:
    paths:
      - "*.deb"
      - "deb-sha256checksum.txt"
    expire_in: 1 week


# Mana Client 64bits AppImage build (unfinished)
mana64-AppImage:
  image: ubuntu:20.04
  stage: build
  tags:
    - gtmw
  before_script:
    - apt-get update -qq
    - chmod +x install_dependencies_mana.sh
    - ./install_dependencies_mana.sh
  script:
    - cd ${CI_PROJECT_DIR}
    - ls
    - chmod +x build_appimg_mana.sh
    - chmod +x linuxdeploy-x86_64.AppImage
    - ./linuxdeploy-x86_64.AppImage --appimage-extract
    - ./build_appimg_mana.sh
    - mv Mana-*-x86_64.AppImage Mana-x86_64.AppImage
    - sha256sum Mana-x86_64.AppImage > x86_64-mana-sha256checksum.txt
    - cd
    - find / -type f -name "*.AppImage"
  artifacts:
    paths:
      - "Mana-x86_64.AppImage"
      - "x86_64-mana-sha256checksum.txt"
    expire_in: 1 week
  allow_failure: true

# deploy
deploy-appImages:
  stage: deploy
  image: alpine
  tags:
    - glados
  before_script:
    - apk add openssh-client zip
    - eval $(ssh-agent -s)
    - mkdir -p ~/.ssh
    - echo "${SSH_PRIVATE_KEY}" | base64 -d | tr -d '\r' > ~/.ssh/id_rsa
    - chmod -R 700 ~/.ssh
  script:
    # Failure prevention, uncomment this on forks!
    #- touch Mana-x86_64.AppImage
    #- touch x86_64-mana-sha256checksum.txt
    # appimgs
    - md5sum ManaPlus-x86_64.AppImage | awk '{print $1}' > ManaPlus-x86_64.AppImage.md5
    - scp -P65001 -o StrictHostKeyChecking=no ManaPlus-x86_64.AppImage $MYHOST:$FILE_LOCATION
#    - scp -P65001 -o StrictHostKeyChecking=no ManaPlus-i386.AppImage $MYHOST:$FILE_LOCATION
    - scp -P65001 -o StrictHostKeyChecking=no Mana-x86_64.AppImage $MYHOST:$FILE_LOCATION
    # debs
    - scp -P65001 -o StrictHostKeyChecking=no manaplus_latest_amd64.deb $MYHOST:$FILE_LOCATION
    - scp -P65001 -o StrictHostKeyChecking=no manaplus-data_latest_all.deb $MYHOST:$FILE_LOCATION
    - scp -P65001 -o StrictHostKeyChecking=no manaplus-dbg_latest_amd64.deb $MYHOST:$FILE_LOCATION
    # checksums
    - scp -P65001 -o StrictHostKeyChecking=no x86_64-sha256checksum.txt $MYHOST:$FILE_LOCATION
    - scp -P65001 -o StrictHostKeyChecking=no x86_64-mana-sha256checksum.txt $MYHOST:$FILE_LOCATION
#    - scp -P65001 -o StrictHostKeyChecking=no i386-sha256checksum.txt $MYHOST:$FILE_LOCATION
    - scp -P65001 -o StrictHostKeyChecking=no deb-sha256checksum.txt $MYHOST:$FILE_LOCATION
    - scp -P65001 -o StrictHostKeyChecking=no ManaPlus-x86_64.AppImage.md5 $MYHOST:$FILE_LOCATION
  only:
    - master