-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 2.12 KB
/
Copy pathpublish.yml
File metadata and controls
75 lines (65 loc) · 2.12 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Publish to GitHub Packages
on:
push:
tags:
- "v*"
permissions:
contents: read
packages: write
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Java and Maven publishing
uses: actions/setup-java@v5
with:
java-version: "25"
distribution: temurin
cache: maven
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Extract version from Git tag
id: version
shell: bash
run: |
if [[ ! "$GITHUB_REF_NAME" =~ ^v3\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then
echo "Expected a Featurevisor Java v3 semantic version tag" >&2
exit 1
fi
version="${GITHUB_REF_NAME#v}"
if ! grep -Fq "<revision>$version</revision>" pom.xml; then
echo "Tag $GITHUB_REF_NAME does not match the Maven revision" >&2
exit 1
fi
if ! grep -Fq "<version>$version</version>" README.md; then
echo "README installation version does not match $GITHUB_REF_NAME" >&2
exit 1
fi
if ! grep -Fq "version = \"$version\"" featurevisor-sdk/src/main/java/com/featurevisor/cli/CLI.java; then
echo "CLI version does not match $GITHUB_REF_NAME" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Publishing Featurevisor Java $version"
- name: Build and test all artifacts
run: >-
mvn --batch-mode
-Drevision=${{ steps.version.outputs.version }}
clean verify
- name: Verify published artifact boundaries
run: bash scripts/verify-artifacts.sh
- name: Publish all artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
mvn --batch-mode
-Drevision=${{ steps.version.outputs.version }}
-DskipTests
deploy