Skip to content

Commit b37e73b

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 b37e73b

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+
pwd
43+
cd releng\jar-for_github-publish
44+
mkdir -p local-maven-repo
45+
46+
install_jars() {
47+
GROUP_ID="$1"
48+
JAR_PATHS="$2"
49+
50+
for jar_path in $JAR_PATHS; do
51+
echo "Installing $jar_path"
52+
53+
ARTIFACT_ID=$(basename "$jar_path" | sed 's/_.*//')
54+
VERSION=$(basename "$jar_path" | sed -n 's/.*_\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')
55+
56+
57+
mvn install:install-file \
58+
-Dfile="$jar_path" \
59+
-DgroupId="$GROUP_ID" \
60+
-DartifactId="$ARTIFACT_ID" \
61+
-Dversion="$VERSION" \
62+
-Dpackaging=jar \
63+
-DgeneratePom=true \
64+
-DlocalRepositoryPath=local-maven-repo
65+
done
66+
}
67+
68+
ENTITY_JAR_PATHS=$(ls | grep -E ".*(org.obeonetwork.dsl.environment_|org.obeonetwork.dsl.environment.edit_)")
69+
install_jars org.obeonetwork.dsl "$ENTITY_JAR_PATHS"
70+
71+
ENTITY_JAR_PATHS=$(ls | grep -E ".*(org.obeonetwork.dsl.entity_|org.obeonetwork.dsl.entity.edit_)")
72+
install_jars org.obeonetwork.dsl "$ENTITY_JAR_PATHS"
73+
74+
ENTITY_JAR_PATHS=$(ls | grep -E ".*(org.obeonetwork.dsl.technicalid_|org.obeonetwork.dsl.technicalid.edit_)")
75+
install_jars org.obeonetwork.dsl "$ENTITY_JAR_PATHS"
76+
77+
ENTITY_JAR_PATHS=$(ls | grep -E ".*net4j.util_")
78+
install_jars org.eclipse.emf.cdo "$ENTITY_JAR_PATHS"
79+
80+
ENTITY_JAR_PATHS=$(ls | grep -E "(.*cdo_|linux.*cdo.common_)")
81+
install_jars org.eclipse.net4j.util "$ENTITY_JAR_PATHS"
82+
83+
# ------------------------------
84+
# Publish to GitHub Packages
85+
# ------------------------------
86+
- name: Deploy all installed artifacts to GitHub Packages
87+
env:
88+
GITHUB_USER: ${{ github.actor }}
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
run: |
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)