Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.08 KiB
include: "https://git.autistici.org/ai3/build-deb/raw/master/ci-common.yml"

pkg_src:
  only:
    - master

build_pkg:bullseye:amd64:
  only:
    - master

upload_pkg:buster:
  variables:
    REPOSITORY: liber/buster

upload_pkg:bullseye:
  variables:
    REPOSITORY: liber/bullseye

upload_pkg:bookworm:
  variables:
    REPOSITORY: liber/bookworm

test:
  stage: test
  image: registry.git.autistici.org/ai3/docker/test/golang:master
  script:
    - run-go-test ./...
  artifacts:
    when: always
    reports:
      coverage_report:
        coverage_format: cobertura
        path: cover.xml
      junit: report.xml

release:
  stage: release
  image: golang:1.19
  variables:
    VERSION: $CI_COMMIT_TAG
  script:
    - mkdir liber-${VERSION}
    - go build -o liber-${VERSION}/liber ./cmd/liber
    - tar czf liber-${VERSION}.tar.gz liber-${VERSION}
    - echo uploading liber-${VERSION}.tar.gz
    - "curl --header \"JOB-TOKEN: $CI_JOB_TOKEN\" --upload-file liber-${VERSION}.tar.gz ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/liber/${VERSION}/liber-${VERSION}.tar.gz"
  only:
    - tags