Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# This is a basic workflow to automate the creation of the build artifact
# Required GitHub Secrets:
# - ARTIFACTORY_USER: SAP Artifactory username
# - ARTIFACTORY_TOKEN: SAP Artifactory access token
name: Release
# Controls when the workflow will run
on:
Expand All @@ -24,3 +27,35 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/actions/bump-version
- name: Setup Maven
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Configure Maven Settings
run: |
mkdir -p ~/.m2
cat > ~/.m2/settings.xml << 'EOF'
<settings>
<servers>
<server>
<id>sap-artifactory</id>
<username>${env.ARTIFACTORY_USER}</username>
<password>${env.ARTIFACTORY_TOKEN}</password>
</server>
</servers>
</settings>
EOF
- name: Get version from package.json
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Update pom.xml version
run: |
mvn versions:set -DnewVersion=${{ steps.version.outputs.version }} -DgenerateBackupPoms=false
echo "✅ Updated pom.xml to version ${{ steps.version.outputs.version }}"
- name: Deploy to SAP Artifactory
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
run: |
mvn deploy -DskipTests
49 changes: 49 additions & 0 deletions deploy-to-artifactory.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

# Deploy UI5 Inspector to SAP Artifactory
# Usage: ./deploy-to-artifactory.sh

REPO_BASE="https://common.repositories.cloud.sap/artifactory/ui5-inspector-releases"

echo "📦 UI5 Inspector - Deploy to Artifactory"
echo ""

# Check credentials
if [ -z "$ARTIFACTORY_USER" ] || [ -z "$ARTIFACTORY_TOKEN" ]; then
echo "❌ Missing credentials. Set ARTIFACTORY_USER and ARTIFACTORY_TOKEN"
exit 1
fi

# Check build artifact
if [ ! -f "package/ui5inspector.zip" ]; then
echo "❌ package/ui5inspector.zip not found. Run 'npm install' first"
exit 1
fi

# Get version
VERSION=$(grep '<version>' pom.xml | head -1 | sed 's/.*<version>\(.*\)<\/version>.*/\1/')

echo "Version: $VERSION"
echo "Artifact: package/ui5inspector.zip ($(du -h package/ui5inspector.zip | cut -f1))"
echo ""

# Confirm
read -p "Deploy to Artifactory? [y/N] " -n 1 -r
echo ""

if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Cancelled"
exit 0
fi

# Deploy
echo ""
echo "Deploying..."
if mvn deploy -DskipTests; then
echo ""
echo "✅ Done! Browse: $REPO_BASE/com/sap/ui5/inspector/package/$VERSION/"
else
echo ""
echo "❌ Deployment failed"
exit 1
fi
81 changes: 67 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sap.ui5.inspector</groupId>
<artifactId>package</artifactId>
<version>0.9.10</version>
<version>1.7.0</version>
<packaging>pom</packaging>

<name>UI5 Inspector</name>
Expand All @@ -18,18 +19,18 @@
</license>
</licenses>

<organization>
<name>SAP</name>
<url>http://www.sap.com</url>
</organization>
<organization>
<name>SAP</name>
<url>http://www.sap.com</url>
</organization>

<developers>
<developer>
<name>UI5</name>
<organization>SAP SE</organization>
<organizationUrl>http://www.sap.com</organizationUrl>
</developer>
</developers>
<developers>
<developer>
<name>UI5</name>
<organization>SAP SE</organization>
<organizationUrl>http://www.sap.com</organizationUrl>
</developer>
</developers>

<scm>
<connection>
Expand All @@ -39,4 +40,56 @@
https://github.com/SAP/ui5-inspector
</url>
</scm>

<distributionManagement>
<repository>
<id>sap-artifactory</id>
<name>SAP Artifactory - UI5 Inspector Releases</name>
<url>https://common.repositories.cloud.sap/artifactory/ui5-inspector-releases</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>attach-edge-artifact</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>package/ui5inspector.zip</file>
<type>zip</type>
<classifier>edge</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
<execution>
<id>attach-chrome-artifact</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>package/ui5inspector.zip</file>
<type>zip</type>
<classifier>chrome</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
10 changes: 9 additions & 1 deletion scripts/update-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@ console.log('Updating version - ' + args[0]);

const packagePath = path.join(path.dirname(__dirname), 'package.json');
const manifestPath = path.join(path.dirname(__dirname), 'app/manifest.json');
const pomPath = path.join(path.dirname(__dirname), 'pom.xml');

const version = args[0];
const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
const manifestJson = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
const pomXml = fs.readFileSync(pomPath, 'utf8');

packageJson.version = version;
manifestJson.version = version;

// Update pom.xml version using regex (targets project version, not plugin versions)
const updatedPomXml = pomXml.replace(
/(<artifactId>package<\/artifactId>\s*\n\s*<version>)[\d.]+(<\/version>)/,
`$1${version}$2`
);

try {
fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2));
fs.writeFileSync(manifestPath, JSON.stringify(manifestJson, null, 4));
//file written successfully
fs.writeFileSync(pomPath, updatedPomXml);
console.log('Update successful');
} catch (err) {
console.error(err);
Expand Down