summaryrefslogtreecommitdiffstats
path: root/.github/workflows/version.yml
blob: 98d28c0e7a8d18ea1afed4d2e3b0c8f890b9b1ad (plain)
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
name: Version
on:
  push:
    branches:
      - master
  pull_request: {}

jobs:
  version:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-go@v2
        with:
          go-version: 1.18.x
      - name: Check version
        # TODO(elippmann): Needs adjustments as soon as we release from (support) branches too.
        run: |
          actual="$(go run cmd/icingadb/main.go --version | head -n1 | sed 's/Icinga DB version: \(.*\)/v\1/')"
          expected="$(git describe --tags $(git rev-list --tags --max-count=1))"
          echo "Actual version:   $actual"
          echo "Expected version: $expected"
          test "$actual" = "$expected" || (echo "Versions do not match"; (exit 1))