-
Notifications
You must be signed in to change notification settings - Fork 92
58 lines (52 loc) · 1.72 KB
/
verify-versions.yml
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Verify versions
on:
workflow_call:
permissions:
contents: read
env:
GATEWAY_VERSION: 1.7.2
jobs:
go:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
name: Verify Go version
steps:
- name: Check Go module version
shell: bash
run: |
echo "Build ref: ${GITHUB_REF}"
GO_GATEWAY_VERSION=${GITHUB_REF#refs/tags/v}
echo "Expected version: ${GATEWAY_VERSION}"
echo "Go module version (git tag): ${GO_GATEWAY_VERSION}"
[ "${GO_GATEWAY_VERSION}" = "${GATEWAY_VERSION}" ] || exit 1
node:
runs-on: ubuntu-latest
name: Verify Node version
steps:
- uses: actions/checkout@v4
- name: Check Node package version
shell: bash
working-directory: node
run: |
PACKAGE_GATEWAY_VERSION=$(jq --raw-output .version package.json)
echo "Expected version: ${GATEWAY_VERSION}"
echo "package.json version: ${PACKAGE_GATEWAY_VERSION}"
[ "${PACKAGE_GATEWAY_VERSION}" = "${GATEWAY_VERSION}" ] || exit 1
java:
runs-on: ubuntu-latest
name: Verify Java version
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: maven
- name: Check Java artifact version
shell: bash
working-directory: java
run: |
POM_GATEWAY_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Expected version: ${GATEWAY_VERSION}"
echo "pom.xml version: ${POM_GATEWAY_VERSION}"
[ "${POM_GATEWAY_VERSION%%-*}" = "${GATEWAY_VERSION}" ] || exit 1