Skip to content

Commit 3569f6c

Browse files
committed
Add github workflow to publish the MM to github package
Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
1 parent 35039a0 commit 3569f6c

10 files changed

Lines changed: 108 additions & 0 deletions

.github/workflows/publish.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Publish meta-model Eclipse Plugins to GitHub Packages
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# ------------------------------
14+
# Checkout
15+
# ------------------------------
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
# ------------------------------
20+
# Setup Java & Maven
21+
# ------------------------------
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: temurin
26+
java-version: 17
27+
cache: maven
28+
29+
# ------------------------------
30+
# Build with Tycho
31+
# ------------------------------
32+
- name: Build using Maven (Tycho)
33+
run: |
34+
cd is-designer/releng
35+
# mvn -f ./org.obeonetwork.is.designer.parent -DskipTests clean verify
36+
37+
# ------------------------------
38+
# Install all Eclipse-plugin JARs locally
39+
# ------------------------------
40+
- name: Install all plugin JARs into local Maven repo
41+
run: |
42+
cd releng/jar-for-github-publish
43+
mkdir -p local-maven-repo
44+
45+
install_jars() {
46+
GROUP_ID="$1"
47+
JAR_PATHS="$2"
48+
49+
for jar_path in $JAR_PATHS; do
50+
echo "Installing $jar_path"
51+
52+
ARTIFACT_ID=$(basename "$jar_path" | sed 's/_.*//')
53+
VERSION=$(basename "$jar_path" | sed -n 's/.*_\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')
54+
55+
56+
mvn install:install-file \
57+
-Dfile="$jar_path" \
58+
-DgroupId="$GROUP_ID" \
59+
-DartifactId="$ARTIFACT_ID" \
60+
-Dversion="$VERSION" \
61+
-Dpackaging=jar \
62+
-DgeneratePom=true \
63+
-DlocalRepositoryPath=local-maven-repo
64+
done
65+
}
66+
67+
ENTITY_JAR_PATHS=$(ls | grep -E ".*(org.obeonetwork.dsl.environment_|org.obeonetwork.dsl.environment.edit_)")
68+
install_jars org.obeonetwork.dsl "$ENTITY_JAR_PATHS"
69+
70+
ENTITY_JAR_PATHS=$(ls | grep -E ".*(org.obeonetwork.dsl.entity_|org.obeonetwork.dsl.entity.edit_)")
71+
install_jars org.obeonetwork.dsl "$ENTITY_JAR_PATHS"
72+
73+
ENTITY_JAR_PATHS=$(ls | grep -E ".*(org.obeonetwork.dsl.technicalid_|org.obeonetwork.dsl.technicalid.edit_)")
74+
install_jars org.obeonetwork.dsl "$ENTITY_JAR_PATHS"
75+
76+
ENTITY_JAR_PATHS=$(ls | grep -E ".*net4j.util_")
77+
install_jars org.eclipse.emf.cdo "$ENTITY_JAR_PATHS"
78+
79+
ENTITY_JAR_PATHS=$(ls | grep -E "(.*cdo_|linux.*cdo.common_)")
80+
install_jars org.eclipse.net4j.util "$ENTITY_JAR_PATHS"
81+
82+
# ------------------------------
83+
# Publish to GitHub Packages
84+
# ------------------------------
85+
- name: Deploy all installed artifacts to GitHub Packages
86+
env:
87+
GITHUB_USER: ${{ github.actor }}
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
run: |
90+
cd releng/jar-for-github-publish
91+
for pom in $(find local-maven-repo -name "*.pom"); do
92+
echo "Found POM: $pom"
93+
ARTIFACT_DIR=$(dirname "$pom")
94+
FILE_JAR=$(ls "$ARTIFACT_DIR"/*.jar | head -n 1)
95+
echo "Found JAR: $FILE_JAR"
96+
97+
# mvn deploy:deploy-file \
98+
# -DrepositoryId=github \
99+
# -Durl="https://maven.pkg.github.com/${{ github.repository }}" \
100+
# -Dfile="$FILE_JAR" \
101+
# -DpomFile="$pom" \
102+
# -DgroupId="$GROUP_ID" \
103+
# -DartifactId="$ARTIFACT_ID" \
104+
# -Dversion="$VERSION" \
105+
# -Dpackaging=jar \
106+
# -DgeneratePom=false \
107+
# -Dtoken=${{ secrets.GITHUB_TOKEN }}
108+
done
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)