test catalog #1624
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
pull_request: | |
branches: | |
- maintenance-3.0.x | |
workflow_call: | |
inputs: | |
branch: | |
description: 'The current branch' | |
default: maintenance-3.0.x | |
type: string | |
required: false | |
secrets: | |
NPM_PACKAGES_TOKEN: | |
description: 'NPM_PACKAGES_TOKEN' | |
required: true | |
env: | |
BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'maintenance-3.0.x' }} | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ env.BRANCH_NAME }} | |
- run: git config --global user.name "nuxeo-webui-jx-bot" && git config --global user.email "[email protected]" | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://packages.nuxeo.com/repository/npm-public/' | |
node-version: 14 | |
scope: '@nuxeo' | |
- name: Install | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm install | |
- name: Lint | |
run: npm run lint | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
- name: 'Update settings.xml with server configuration' | |
run: | | |
echo '<settings> | |
<mirrors> | |
<mirror> | |
<id>nos-team</id> | |
<mirrorOf>external:*</mirrorOf> | |
<url>https://nexus-jx.nos.build.nuxeo.com/repository/maven-group/</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 |