.gitlab-ci.yml 6.48 KB
Newer Older
Konstantin Pavlov's avatar
Konstantin Pavlov committed
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
stages:
    - build
    - test
    - release

.variables-debian-amd64: &variables-debian-amd64
    _TRIPLET: ""
    _PLATFORMSUFFIX: ""
    _PATH: "debian-x86_64"
    _WRAPPER: ""

.variables-debian-aarch64: &variables-debian-aarch64
    _TRIPLET: ""
    _PLATFORMSUFFIX: ""
    _PATH: "debian-aarch64"
    _WRAPPER: ""

.variables-win32: &variables-win32
    _TRIPLET: "i686-w64-mingw32"
    _PLATFORMSUFFIX: ".exe"
    _PATH: "win32"
    _WRAPPER: "wine"

.variables-win64: &variables-win64
    _TRIPLET: "x86_64-w64-mingw32"
    _PLATFORMSUFFIX: ".exe"
    _PATH: "win64"
    _WRAPPER: "wine64"

.variables-macos: &variables-macos
31
    _TRIPLET: "x86_64-apple-darwin18"
Konstantin Pavlov's avatar
Konstantin Pavlov committed
32 33 34 35 36 37 38 39
    _PLATFORMSUFFIX: ""
    _PATH: "macos-x86_64"
    _WRAPPER: ""

.build:
    stage: build
    script: |
        set -x
40 41 42 43 44
        LOCAL_INSTALL_DIR=`pwd`/local_install
        export PKG_CONFIG_LIBDIR=${LOCAL_INSTALL_DIR}/lib/pkgconfig
        git clone --depth 1 --branch master https://git.ffmpeg.org/ffmpeg.git ffmpeg
        cd ffmpeg
        ./configure --prefix="${LOCAL_INSTALL_DIR}" --enable-pic --disable-debug --extra-ldflags="-static" --disable-programs --disable-doc --disable-avdevice --disable-postproc --disable-avfilter --disable-network --disable-encoders --disable-muxers
Konstantin Pavlov's avatar
Konstantin Pavlov committed
45
        make -j$(getconf _NPROCESSORS_ONLN)
46 47 48 49 50 51 52
        make -j$(getconf _NPROCESSORS_ONLN) install
        cd ..
        git clone --depth 1 --branch master https://github.com/l-smash/l-smash.git lsmash
        cd lsmash
        ./configure --prefix="${LOCAL_INSTALL_DIR}" --extra-ldflags="-static"
        make -j$(getconf _NPROCESSORS_ONLN)
        make -j$(getconf _NPROCESSORS_ONLN) install
Konstantin Pavlov's avatar
Konstantin Pavlov committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
        cd ..
        ./configure --enable-pic --enable-strip --extra-ldflags="-static"
        make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
    artifacts:
        name: "$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
        paths:
            - x264${_PLATFORMSUFFIX}
            - checkasm8${_PLATFORMSUFFIX}
            - checkasm10${_PLATFORMSUFFIX}
        expire_in: 1 week

build-debian-amd64:
    extends: .build
    image: registry.videolan.org/x264-debian-unstable:20190404162201
    tags:
        - docker
        - amd64
    variables: *variables-debian-amd64

build-debian-aarch64:
    extends: .build
74
    image: registry.videolan.org/x264-debian-unstable-aarch64:20190716192245
Konstantin Pavlov's avatar
Konstantin Pavlov committed
75 76 77 78 79 80 81 82 83
    tags:
        - docker
        - aarch64
    variables: *variables-debian-aarch64

.build-win:
    extends: build-debian-amd64
    script: |
        set -x
84 85 86
        LOCAL_INSTALL_DIR=`pwd`/${_TRIPLET}
        export PKG_CONFIG_LIBDIR=${LOCAL_INSTALL_DIR}/lib/pkgconfig
        curl -f -o vlc-contrib-${_TRIPLET}-latest.tar.bz2 https://nightlies.videolan.org/build/contribs/vlc-contrib-${_TRIPLET}-latest.tar.bz2
Konstantin Pavlov's avatar
Konstantin Pavlov committed
87 88
        bunzip2 vlc-contrib-${_TRIPLET}-latest.tar.bz2
        tar xvf vlc-contrib-${_TRIPLET}-latest.tar
89 90 91 92 93 94 95 96
        sed -i "s#@@CONTRIB_PREFIX@@#${LOCAL_INSTALL_DIR}#g" ${PKG_CONFIG_LIBDIR}/*.pc
        git clone --depth 1 --branch master https://github.com/l-smash/l-smash.git lsmash
        cd lsmash
        ./configure --prefix="${LOCAL_INSTALL_DIR}" --target-os="${_TRIPLET}" --cross-prefix="${_TRIPLET}-"
        make -j$(getconf _NPROCESSORS_ONLN)
        make -j$(getconf _NPROCESSORS_ONLN) install
        cd ..
        ./configure --host="${_TRIPLET}" --cross-prefix="${_TRIPLET}-" --enable-pic --enable-strip
Konstantin Pavlov's avatar
Konstantin Pavlov committed
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
        make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm

build-win32:
    extends: .build-win
    variables: *variables-win32

build-win64:
    extends: .build-win
    variables: *variables-win64

build-macos:
    extends: .build
    tags:
        - macos
    script: |
        set -x
113 114 115
        LOCAL_INSTALL_DIR=`pwd`/${_TRIPLET}
        export PKG_CONFIG_LIBDIR=${LOCAL_INSTALL_DIR}/lib/pkgconfig
        curl -f -o vlc-contrib-${_TRIPLET}-latest.tar.bz2 https://nightlies.videolan.org/build/contribs/vlc-contrib-${_TRIPLET}-latest.tar.bz2
Konstantin Pavlov's avatar
Konstantin Pavlov committed
116 117
        bunzip2 vlc-contrib-${_TRIPLET}-latest.tar.bz2
        tar xvf vlc-contrib-${_TRIPLET}-latest.tar
118 119 120 121 122 123 124 125
        sed -i.bak "s#@@CONTRIB_PREFIX@@#${LOCAL_INSTALL_DIR}#g" ${PKG_CONFIG_LIBDIR}/*.pc
        git clone --depth 1 --branch master https://github.com/l-smash/l-smash.git lsmash
        cd lsmash
        ./configure --prefix="${LOCAL_INSTALL_DIR}"
        make -j$(getconf _NPROCESSORS_ONLN)
        make -j$(getconf _NPROCESSORS_ONLN) install
        cd ..
        ./configure --enable-pic --enable-strip
Konstantin Pavlov's avatar
Konstantin Pavlov committed
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
        make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
    variables: *variables-macos

.test: &test
    stage: test
    script: |
        set -x
        ${_WRAPPER} ./checkasm8${_PLATFORMSUFFIX}
        ${_WRAPPER} ./checkasm10${_PLATFORMSUFFIX}
    artifacts:
        expire_in: 10 minutes

test-debian-amd64:
    <<: *test
    extends: build-debian-amd64
    dependencies:
        - build-debian-amd64
    variables: *variables-debian-amd64

test-debian-aarch64:
    <<: *test
    extends: build-debian-aarch64
    dependencies:
        - build-debian-aarch64
    variables: *variables-debian-aarch64

test-win32:
    <<: *test
    extends: build-win32
    dependencies:
        - build-win32
    variables: *variables-win32

test-win64:
    <<: *test
    extends: build-win64
    dependencies:
        - build-win64
    variables: *variables-win64

test-macos:
    <<: *test
    extends: build-macos
    dependencies:
        - build-macos
    variables: *variables-macos

.release: &release
    stage: release
    script: |
        set -x
        _VERSION=$(./version.sh | grep _VERSION -| cut -d\  -f4-| sed 's, ,-,g' | sed 's,",,')
        mv x264${_PLATFORMSUFFIX} x264-${_VERSION}${_PLATFORMSUFFIX}
    when: manual
    only:
        - master@videolan/x264
        - stable@videolan/x264
    artifacts:
        name: "$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
        paths:
            - x264-*${_PLATFORMSUFFIX}
        expire_in: '10 minutes'

release-debian-amd64:
    <<: *release
    extends: build-debian-amd64
    dependencies:
        - build-debian-amd64
    variables: *variables-debian-amd64

release-debian-aarch64:
    <<: *release
    extends: build-debian-aarch64
    dependencies:
        - build-debian-aarch64
    variables: *variables-debian-aarch64

release-win32:
    <<: *release
    extends: build-win32
    dependencies:
        - build-win32
    variables: *variables-win32

release-win64:
    <<: *release
    extends: build-win64
    dependencies:
        - build-win64
    variables: *variables-win64

release-macos:
    <<: *release
    extends: build-macos
    dependencies:
        - build-macos
    variables: *variables-macos