stages:
  - build
  - release

before_script:
  - mkdir -p _ccache
  - export CCACHE_BASEDIR=${PWD}
  - export CCACHE_DIR=${PWD}/_ccache

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - _ccache/

build-alpine-meson:
  image: alpine:edge
  stage: build
  script:
   - apk add --no-cache python3 gtk+3.0-dev vala meson ninja libwnck3-dev build-base git gtk-layer-shell-dev
   - meson bld --prefix=/usr && cd bld
   - ninja dist
  artifacts:
    paths:
    - "bld/meson-dist/vala-panel*.tar.xz"
    expire_in: 1 week

release-main:
  image: alpine:edge
  stage: release
  script:
    - apk add --no-cache python3 py3-pip
    - pip3 install gitlab_release
    - python3 -m gitlab_release ${PRIVATE_TOKEN} bld/meson-dist/vala-panel*.tar.xz
  only:
    - tags
