summaryrefslogblamecommitdiff
path: root/.gitlab-ci.yml
blob: 360471440ca92f5be9819aa5cdc032a38b449d69 (plain) (tree)
1
2
3
4
5
6
7
8
9
       
         

          

                      
                      

              
          



                                      
         
                          
        
                              
                                          
                                                      
                       

                                                                    
        
                                       

            
                                  






                                   
          




                                      
                          
        
                              

                                                    
                       








                                                                



                      
          





                                      
                                                                   
















                                                                       



                 
       
            



                                
                                                                        

                         
             

                                                                                     







                                                                                          
 
stages:
  - build
  - deploy

# x86_64 AppImage buid
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"

# 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"

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"

# 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:
    # appimgs
    - scp -o StrictHostKeyChecking=no ManaPlus-x86_64.AppImage $MYHOST:$FILE_LOCATION
    - scp -o StrictHostKeyChecking=no ManaPlus-i386.AppImage $MYHOST:$FILE_LOCATION
    # debs
    - scp -o StrictHostKeyChecking=no manaplus_latest_amd64.deb $MYHOST:$FILE_LOCATION
    - scp -o StrictHostKeyChecking=no manaplus-data_latest_all.deb $MYHOST:$FILE_LOCATION
    - scp -o StrictHostKeyChecking=no manaplus-dbg_latest_amd64.deb $MYHOST:$FILE_LOCATION
    # checksums
    - scp -o StrictHostKeyChecking=no x86_64-sha256checksum.txt $MYHOST:$FILE_LOCATION
    - scp -o StrictHostKeyChecking=no i386-sha256checksum.txt $MYHOST:$FILE_LOCATION
    - scp -o StrictHostKeyChecking=no deb-sha256checksum.txt $MYHOST:$FILE_LOCATION