File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag :
7+ type : string
8+ description : Tag to publish (e.g. v2.0.16)
9+ required : true
10+
11+ jobs :
12+ validate-tag :
13+ name : Validate tag
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v6
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Verify tag exists
22+ run : |
23+ TAG="${{ github.event.inputs.tag }}"
24+ if [ -z "$TAG" ]; then
25+ echo "Error: Tag is required."
26+ exit 1
27+ fi
28+ if ! git rev-parse "$TAG" >/dev/null 2>&1; then
29+ echo "Error: Tag '$TAG' does not exist."
30+ exit 1
31+ fi
32+ echo "Publishing tag: $TAG"
33+
34+ publish :
35+ name : Test, release build and publish
36+ needs : [validate-tag]
37+ if : ${{ !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
38+ runs-on : ubuntu-latest
39+ steps :
40+ - name : Checkout tag
41+ uses : actions/checkout@v6
42+ with :
43+ ref : ${{ github.event.inputs.tag }}
44+
45+ - name : Set up Maven Central Repository
46+ uses : actions/setup-java@v5
47+ with :
48+ java-version : 21
49+ distribution : ' temurin'
50+ server-id : central
51+ server-username : MAVEN_USERNAME
52+ server-password : MAVEN_PASSWORD
53+ gpg-private-key : ${{ secrets.SIGNING_KEY }}
54+ gpg-passphrase : MAVEN_GPG_PASSPHRASE
55+
56+ - name : Publish to Maven Central
57+ run : cd zero-bounce-sdk && mvn --no-transfer-progress --batch-mode -Dgpg.passphrase=${MAVEN_GPG_PASSPHRASE} clean deploy -Prelease
58+ env :
59+ MAVEN_USERNAME : ${{ secrets.CENTRAL_TOKEN_USERNAME }}
60+ MAVEN_PASSWORD : ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
61+ MAVEN_GPG_PASSPHRASE : ${{ secrets.SIGNING_PASSWORD }}
You can’t perform that action at this time.
0 commit comments