-
Notifications
You must be signed in to change notification settings - Fork 274
117 lines (101 loc) · 4.11 KB
/
tag-registry-examples.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Tag Registry Examples
on:
workflow_dispatch:
inputs:
release-version:
description: 'Registry Release Version'
required: true
snapshot-version:
description: 'Next snapshot version'
required: true
workflow_call:
inputs:
release-version:
required: true
type: string
snapshot-version:
required: true
type: string
jobs:
tag-registry-examples:
runs-on: ubuntu-20.04
if: false # Registry Examples repository is archived, since we moved them to the Registry repository. This workflow can be later removed.
steps:
- name: Set Versions
run: |
set -x
if [ -z "${{inputs.release-version}}" ] || [ -z "${{inputs.snapshot-version}}" ]
then
echo "Workflow Triggered via workflow_dispatch event. Setting Versions as ENV variables..."
echo "RELEASE_VERSION=${{ github.event.inputs.release-version }}" >> $GITHUB_ENV
echo "SNAPSHOT_VERSION=${{ github.event.inputs.snapshot-version }}" >> $GITHUB_ENV
else
echo "Workflow Triggered via workflow_call event. Setting Versions as ENV variables..."
echo "RELEASE_VERSION=${{ inputs.release-version }}" >> $GITHUB_ENV
echo "SNAPSHOT_VERSION=${{ inputs.snapshot-version }}" >> $GITHUB_ENV
fi
- name: Print Env variables
run: |
echo "Release Version: $RELEASE_VERSION"
echo "Snapshot Version: $SNAPSHOT_VERSION"
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Configure Git
run: |
git config --global user.name "apicurio-ci"
git config --global user.email "apicurio.ci@gmail.com"
- name: Checkout Apicurio Registry Tag ${{ env.RELEASE_VERSION }}
uses: actions/checkout@v3
with:
ref: ${{ env.RELEASE_VERSION }}
path: apicurio-registry
- name: Build Apicurio Registry
env:
SKIP_TESTS: "true"
run: cd apicurio-registry && make build-all
- name: Checkout Apicurio Registry Examples
uses: actions/checkout@v3
with:
repository: Apicurio/apicurio-registry-examples
path: apicurio-registry-examples
token: ${{ secrets.ACCESS_TOKEN }}
- name: list files
run: ls -lrt
- name: Update Release Version ${{ env.RELEASE_VERSION }}
run: |
cd apicurio-registry-examples
mvn versions:set -DnewVersion=${{ env.RELEASE_VERSION }} -DgenerateBackupPoms=false -DprocessAllModules=true
mvn versions:set-property -Dproperty=apicurio-registry.version -DgenerateBackupPoms=false -DnewVersion=${{ env.RELEASE_VERSION }}
- name: Build Registry Examples
run: cd apicurio-registry-examples && ./mvnw clean install
- name: Commit Release Version Changes
run: |
cd apicurio-registry-examples
git add .
git commit -m "Automated update to Release Version:: ${{ env.RELEASE_VERSION }}"
git push origin main
- name: Tag Examples
run: |
cd apicurio-registry-examples
git tag -a -m "Tagging release ${{ env.RELEASE_VERSION }}" ${{ env.RELEASE_VERSION }}
git push origin ${{ env.RELEASE_VERSION }}
- name: Update Snapshot Version ${{ env.SNAPSHOT_VERSION }}
run: |
cd apicurio-registry-examples
mvn versions:set -DnewVersion=${{ env.SNAPSHOT_VERSION }} -DgenerateBackupPoms=false -DprocessAllModules=true
- name: Commit Snapshot Version Changes
run: |
cd apicurio-registry-examples
git add .
git commit -m "Automated update to next Snapshot Version: ${{ env.SNAPSHOT_VERSION }}"
git push origin main
- name: Google Chat Notification
if: ${{ failure() }}
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
with:
name: ${{ github.workflow }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
status: ${{ job.status }}