-
Notifications
You must be signed in to change notification settings - Fork 504
134 lines (119 loc) · 4.99 KB
/
release.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Release Workflow
on:
workflow_dispatch:
inputs:
release-version:
description: 'Version being released'
required: true
snapshot-version:
description: 'Next snapshot version'
required: true
branch:
description: 'Branch to release from'
required: true
default: 'main'
jobs:
release:
runs-on: ubuntu-latest
if: github.repository_owner == 'Apicurio'
steps:
- name: Log Metadata
run: |
echo "==========================================================================================================="
echo "Release Module: ${{ env.GITHUB_REPOSITORY }}
echo "Release Version: ${{ github.event.inputs.release-version }}
echo "Release Branch: ${{ github.event.inputs.branch }}"
echo "Release Actor: ${{ env.GITHUB_ACTOR }}"
echo "Next Snapshot Version: ${{ github.event.inputs.snapshot-version }}"
echo "==========================================================================================================="
- name: Configure Git
run: |
git config --global user.name "apicurio-ci[bot]"
git config --global user.email "[email protected]"
- name: Checkout Code with Ref ${{github.event.inputs.BRANCH}}
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.ACCESS_TOKEN }}
path: studio
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Update Release Version ${{ github.event.inputs.release-version }} in pom.xml
run: |
cd studio
mvn versions:set -DnewVersion=${{ github.event.inputs.release-version }} -DgenerateBackupPoms=false -DprocessAllModules=true
cd ui
npm version ${{ github.event.inputs.release-version }}
cd ui-app
npm version ${{ github.event.inputs.release-version }}
cd ../ui-editors
npm version ${{ github.event.inputs.release-version }}
- name: Build Apicurio Studio
run: |
cd studio
mvn install -Dmaven.javadoc.skip=false --no-transfer-progress -DtrimStackTrace=false -Pprod
cd ui
npm install
npm run build
npm run package
- name: Import GPG Key
if: github.event.inputs.skip-maven-deploy == 'false'
uses: crazy-max/ghaction-import-gpg@v1
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Push Changes for Release Version ${{ github.event.inputs.release-version }}
run: |
cd studio
git add .
git commit -m "Automated update for Release Version: ${{ github.event.inputs.release-version }}"
git push origin ${{github.event.inputs.branch}}
- name: Fetch Latest Commit SHA
run: |
cd studio
echo "latest-commit-sha=$(git log -n 1 --pretty=format:"%H")" >> $GITHUB_ENV
- name: Create GitHub Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
with:
name: ${{ github.event.inputs.release-version }}
tag_name: ${{ github.event.inputs.release-version }}
token: ${{ secrets.ACCESS_TOKEN }}
target_commitish: ${{ env.latest-commit-sha }}
prerelease: false
- name: Update Next Snapshot Version ${{ github.event.inputs.snapshot-version }}
run: |
cd studio
mvn versions:set -DnewVersion=${{ github.event.inputs.snapshot-version }} -DgenerateBackupPoms=false -DprocessAllModules=true
cd ui
npm version ${{ github.event.inputs.snapshot-version }}
cd ui-app
npm version ${{ github.event.inputs.snapshot-version }}
cd ../ui-editors
npm version ${{ github.event.inputs.snapshot-version }}
- name: Push Changes for Next Snapshot Version ${{ github.event.inputs.snapshot-version }}
run: |
cd studio
git add .
git commit -m "Automated update for Next Snapshot Version: ${{ github.event.inputs.snapshot-version }}"
git push origin ${{github.event.inputs.branch}}
- name: Google Chat Notification (Always)
if: always()
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
with:
name: ${{ github.job }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
status: ${{ job.status }}
- name: Google Chat Notification (Error)
if: failure()
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
with:
name: ${{ github.job }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_ERRORS }}
status: ${{ job.status }}