-
Notifications
You must be signed in to change notification settings - Fork 60
155 lines (136 loc) · 6.11 KB
/
catalog.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# # This workflow generates a new version of the catalog used by Nuxeo Studio Designer.
# # Note: some Catalog dependencies require Node 10.x to work.
# name: Designer Catalog Generator
# on:
# workflow_dispatch:
# inputs:
# target_platform:
# description: 'The Nuxeo server target platform to build the catalog for.'
# default: '11.3'
# required: true
# branch_name:
# description: 'The name of the Nuxeo Web UI branch to generate the catalog for.'
# default: 'maintenance-3.0.x'
# required: true
# classifier:
# description: 'Classifier to name a custom version of the catalog (used for testing purposes).'
# default: ''
# required: false
# release:
# types: [published]
# env:
# ARTIFACT_ID: view-designer-catalog
# GROUP_ID: org.nuxeo.web.ui.studio
# jobs:
# catalog:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - run: git config --global user.name "nuxeo-webui-jx-bot" && git config --global user.email "[email protected]"
# - uses: actions/setup-node@v3
# with:
# node-version: 14
# - uses: actions/setup-java@v3
# with:
# distribution: 'zulu'
# java-version: '11'
# - name: 'Update settings.xml with server configuration'
# run: |
# echo '<settings>
# <mirrors>
# <mirror>
# <id>maven-internal</id>
# <mirrorOf>external:*</mirrorOf>
# <url>https://packages.nuxeo.com/repository/maven-internal/</url>
# </mirror>
# </mirrors>
# <servers>
# <server>
# <id>nos-team</id>
# <username>nuxeo-webui-jx-bot</username>
# <password>${{ secrets.WEBUI_JX_BOT_GITHUB_ACTIONS_TOKEN }}</password>
# </server>
# <server>
# <id>maven-internal</id>
# <username>${{ secrets.PACKAGES_AUTH_USER }}</username>
# <password>${{ secrets.PACKAGES_AUTH_TOKEN }}</password>
# </server>
# <server>
# <id>maven-public-releases</id>
# <username>${{ secrets.PACKAGES_AUTH_USER }}</username>
# <password>${{ secrets.PACKAGES_AUTH_TOKEN }}</password>
# </server>
# <server>
# <id>maven-public-snapshots</id>
# <username>${{ secrets.PACKAGES_AUTH_USER }}</username>
# <password>${{ secrets.PACKAGES_AUTH_TOKEN }}</password>
# </server>
# </servers>
# </settings>' > ~/.m2/settings.xml
# - name: Install libxml2-utils (xmllint)
# run: sudo apt-get update && sudo apt-get install -y libxml2-utils
# - name: Setup parameters (release)
# if: github.event_name == 'release'
# working-directory: packages/nuxeo-designer-catalog
# run: |
# echo "BRANCH_NAME=v${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV
# echo "TARGET_PLATFORM=11.3" >> $GITHUB_ENV
# - name: Setup parameters (workflow_dispatch)
# if: github.event_name == 'workflow_dispatch'
# run: |
# echo "BRANCH_NAME=${{ github.event.inputs.branch_name }}" >> $GITHUB_ENV
# echo "TARGET_PLATFORM=${{ github.event.inputs.target_platform }}" >> $GITHUB_ENV
# - name: Install dependencies
# working-directory: packages/nuxeo-designer-catalog
# run: |
# npm install
# npm install -g gulp
# - name: Generate catalog
# working-directory: packages/nuxeo-designer-catalog
# run: |
# gulp catalog --tp $TARGET_PLATFORM --webui-branch $BRANCH_NAME
# gulp hints --tp $TARGET_PLATFORM
# - name: Bundle the catalog
# run: |
# sudo chmod +r pom.xml
# CATALOG_VERSION=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)${{ github.event.inputs.classifier }}
# pushd packages/nuxeo-designer-catalog/data/applications/nuxeo/${{ env.TARGET_PLATFORM }}
# echo "CATALOG_VERSION=$CATALOG_VERSION" >> $GITHUB_ENV
# CATALOG_NAME=$ARTIFACT_ID-$CATALOG_VERSION.zip
# echo "CATALOG_NAME=$CATALOG_NAME" >> $GITHUB_ENV
# zip -q -r $CATALOG_NAME nuxeo-web-ui data hints catalog.json
# popd
# - name: Archive catalog
# uses: actions/upload-artifact@v3
# with:
# name: catalog
# path: packages/nuxeo-designer-catalog/data/applications/nuxeo/${{ env.TARGET_PLATFORM }}/${{ env.CATALOG_NAME }}
# - name: Upload catalog
# working-directory: packages/nuxeo-designer-catalog
# run: |
# MVN_REPO_ID=maven-public-releases
# MVN_REPO_URL=https://packages.nuxeo.com/repository/maven-public-releases/
# if [[ $CATALOG_VERSION == *-SNAPSHOT ]]; then
# MVN_REPO_ID=maven-public-snapshots
# MVN_REPO_URL=https://packages.nuxeo.com/repository/maven-public-snapshots/
# fi
# pushd data/applications/nuxeo/$TARGET_PLATFORM
# mvn deploy:deploy-file -Dfile=$CATALOG_NAME -DgroupId=$GROUP_ID -DartifactId=$ARTIFACT_ID -Dversion=$CATALOG_VERSION -Dpackaging=zip -DrepositoryId=$MVN_REPO_ID -Durl=$MVN_REPO_URL
# popd
# - name: Checkout NOS repository
# uses: actions/checkout@v3
# with:
# repository: nuxeo/nos
# token: ${{ secrets.WEBUI_JX_BOT_GITHUB_ACTIONS_TOKEN }}
# path: nos
# - name: Create pull request for catalog update in NOS
# working-directory: nos
# env:
# GH_TOKEN: ${{ secrets.WEBUI_JX_BOT_GITHUB_ACTIONS_TOKEN }}
# run: |
# git checkout -b designer-catalog-update-$CATALOG_VERSION
# mvn versions:set-property -Dproperty=view.designer.catalog.11.3 -DnewVersion=$CATALOG_VERSION
# git add .
# git commit -m "Update Designer catalog with version $CATALOG_VERSION"
# git push origin designer-catalog-update-$CATALOG_VERSION
# gh pr create --base master --fill