stages:
- build

linux:
    stage: build
    script:
        - apt-get update
        - apt-get install --no-install-recommends xz-utils curl git ca-certificates -y
        - git submodule update --recursive --init
        - curl -L https://github.com/AnarchyTools/atbuild/releases/download/0.10.0/atbuild-0.10.0-linux.tar.xz | tar xJ
        - cp atbuild-*/atbuild /usr/local/bin/
        - atbuild check
        - atbuild atpm
        - mkdir atpm-${CI_BUILD_REF}
        - cp bin/atpm atpm-${CI_BUILD_REF}
        - tar cJf atpm-${CI_BUILD_REF}-linux.tar.xz atpm-${CI_BUILD_REF}
    tags:
        - autoscale-linux
    image: drewcrawford/swift:latest
    artifacts:
        paths:
            - atpm-${CI_BUILD_REF}-linux.tar.xz

osx:
    stage: build
    script:
        - git submodule update --recursive --init
        - atbuild check
        - atbuild atpm
        - mkdir atpm-${CI_BUILD_REF}
        - cp bin/atpm atpm-${CI_BUILD_REF}
        - tar cJf atpm-${CI_BUILD_REF}-osx.tar.xz atpm-${CI_BUILD_REF}
    tags:
        - openswift
        - atbuild
    artifacts:
        paths:
            - atpm-${CI_BUILD_REF}-osx.tar.xz

stages:
- build

linux:
    stage: build
    script:
        - apt-get update
        - apt-get install --no-install-recommends xz-utils curl git ca-certificates -y
        - git submodule update --recursive --init
        - curl -L https://github.com/AnarchyTools/atbuild/releases/download/0.10.0/atbuild-0.10.0-linux.tar.xz | tar xJ
        - cp atbuild-*/atbuild /usr/local/bin/
        - atbuild check
        - atbuild atpm --use-overlay static
        - mkdir atpm-${CI_BUILD_REF}
        - cp bin/atpm atpm-${CI_BUILD_REF}
        - tar cJf atpm-${CI_BUILD_REF}-linux.tar.xz atpm-${CI_BUILD_REF}
    tags:
        - autoscale-linux
    image: drewcrawford/swift:latest
    artifacts:
        paths:
            - atpm-${CI_BUILD_REF}-linux.tar.xz

osx:
    stage: build
    script:
        - git submodule update --recursive --init
        - atbuild check
        - atbuild atpm --use-overlay static
        - mkdir atpm-${CI_BUILD_REF}
        - cp bin/atpm atpm-${CI_BUILD_REF}
        - tar cJf atpm-${CI_BUILD_REF}-osx.tar.xz atpm-${CI_BUILD_REF}
    tags:
        - openswift
        - atbuild
    artifacts:
        paths:
            - atpm-${CI_BUILD_REF}-osx.tar.xz

Use static overlay for CI
Use static overlay for CI
