|
17 | 17 | # ** https://riseclipse.github.io |
18 | 18 | # ************************************************************************* |
19 | 19 |
|
20 | | -name: Do nothing |
| 20 | +name: Build and deploy snapshot rcp products |
| 21 | + |
| 22 | +# This CI workflow builds development versions of RiseClipse RCP Applications. |
| 23 | +# It uses snapshot components from OSSRH Nexus snapshot repository |
| 24 | +# Development versions are uploaded to RiseClipseWeb |
| 25 | +# It send email about these new development versions |
21 | 26 |
|
22 | 27 | on: workflow_dispatch |
23 | 28 |
|
24 | 29 | jobs: |
25 | | - build: |
| 30 | + build-products: |
26 | 31 | # Use a specific version to avoid unattended changes with latest |
27 | 32 | runs-on: ubuntu-24.04 |
28 | | - name: do nothing for now |
| 33 | + name: Build rcp products |
29 | 34 |
|
30 | 35 | steps: |
31 | | - - name: say hello |
| 36 | + - name: Checkout ${{ github.event.repository.name }} |
| 37 | + uses: actions/checkout@v4 |
| 38 | + with: |
| 39 | + path: ${{ github.event.repository.name }} |
| 40 | + ref: develop |
| 41 | + fetch-depth: 0 |
| 42 | + |
| 43 | + - name: Setup Java |
| 44 | + uses: actions/setup-java@v4 |
| 45 | + with: |
| 46 | + distribution: 'temurin' |
| 47 | + java-version: '21' |
| 48 | + cache: 'maven' |
| 49 | + |
| 50 | + - name: Checkout riseclipse-developper |
| 51 | + uses: actions/checkout@v4 |
| 52 | + with: |
| 53 | + repository: riseclipse/riseclipse-developer |
| 54 | + path: riseclipse-developer |
| 55 | + ref: develop |
| 56 | + |
| 57 | + - name: Install root pom of develop branch |
32 | 58 | run: | |
33 | | - echo "hello" |
| 59 | + cd riseclipse-developer |
| 60 | + mvn --batch-mode install -Pdeploy-snapshots |
| 61 | +
|
| 62 | + # RiseClipse plugins are not found when building rcp products even if they are |
| 63 | + # available on https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/github/riseclipse/ |
| 64 | + # It's OK when building update-site, but not for rcp ?? |
| 65 | + # So we install plugins on the runner |
| 66 | + |
| 67 | + - name: Checkout riseclipse-main |
| 68 | + uses: actions/checkout@v4 |
| 69 | + with: |
| 70 | + repository: riseclipse/riseclipse-main |
| 71 | + path: riseclipse-main |
| 72 | + ref: develop |
| 73 | + |
| 74 | + - name: Install main plugin |
| 75 | + run: | |
| 76 | + cd riseclipse-main |
| 77 | + mvn --batch-mode install -Pdeploy-snapshots |
| 78 | +
|
| 79 | + - name: Checkout riseclipse-editor |
| 80 | + uses: actions/checkout@v4 |
| 81 | + with: |
| 82 | + repository: riseclipse/riseclipse-editor |
| 83 | + path: riseclipse-editor |
| 84 | + ref: develop |
| 85 | + |
| 86 | + - name: Install editor plugin |
| 87 | + run: | |
| 88 | + cd riseclipse-editor |
| 89 | + mvn --batch-mode install -Pdeploy-snapshots |
| 90 | +
|
| 91 | + - name: Checkout riseclipse-metamodel-scl2003 |
| 92 | + uses: actions/checkout@v4 |
| 93 | + with: |
| 94 | + repository: riseclipse/riseclipse-metamodel-scl2003 |
| 95 | + path: riseclipse-metamodel-scl2003 |
| 96 | + ref: develop |
| 97 | + |
| 98 | + - name: Install metamodel-scl2003 plugin |
| 99 | + run: | |
| 100 | + cd riseclipse-metamodel-scl2003 |
| 101 | + mvn --batch-mode install -Pdeploy-snapshots |
| 102 | +
|
| 103 | + - name: Checkout riseclipse-metamodel-nsd2016 |
| 104 | + uses: actions/checkout@v4 |
| 105 | + with: |
| 106 | + repository: riseclipse/riseclipse-metamodel-nsd2016 |
| 107 | + path: riseclipse-metamodel-nsd2016 |
| 108 | + ref: develop |
| 109 | + |
| 110 | + - name: Install metamodel-nsd2016 plugin |
| 111 | + run: | |
| 112 | + cd riseclipse-metamodel-nsd2016 |
| 113 | + mvn --batch-mode install -Pdeploy-snapshots |
| 114 | +
|
| 115 | + - name: Build rcp |
| 116 | + run: | |
| 117 | + cd ${{ github.event.repository.name }} |
| 118 | + mvn --file pom_rcp.xml --batch-mode verify -Pdeploy-snapshots |
| 119 | + |
| 120 | + - name: upload macos products |
| 121 | + uses: actions/upload-artifact@v4 |
| 122 | + with: |
| 123 | + name: macos-artifacts |
| 124 | + path: riseclipse-distribution/fr.centralesupelec.edf.riseclipse.rcp.product/target/products/*macosx* |
| 125 | + compression-level: 0 |
| 126 | + overwrite: true |
| 127 | + |
| 128 | + - name: upload other products |
| 129 | + uses: actions/upload-artifact@v4 |
| 130 | + with: |
| 131 | + name: other-artifacts |
| 132 | + path: | |
| 133 | + riseclipse-distribution/fr.centralesupelec.edf.riseclipse.rcp.product/target/products/*linux* |
| 134 | + riseclipse-distribution/fr.centralesupelec.edf.riseclipse.rcp.product/target/products/*win32* |
| 135 | + compression-level: 0 |
| 136 | + overwrite: true |
| 137 | + |
| 138 | + build-dmg: |
| 139 | + # Runs on macOS to build dmg |
| 140 | + runs-on: macos-15 |
| 141 | + name: Build dmg |
| 142 | + needs: build-products |
| 143 | + |
| 144 | + steps: |
| 145 | + - name: download products |
| 146 | + uses: actions/download-artifact@v4 |
| 147 | + with: |
| 148 | + name: macos-artifacts |
| 149 | + |
| 150 | + - name: untar macos products |
| 151 | + run: | |
| 152 | + mkdir x86_64 |
| 153 | + tar -C x86_64 -zxf fr.centralesupelec.edf.riseclipse.iec61850.rcp.product-macosx.cocoa.x86_64.tar.gz |
| 154 | + rm fr.centralesupelec.edf.riseclipse.iec61850.rcp.product-macosx.cocoa.x86_64.tar.gz |
| 155 | + mkdir aarch64 |
| 156 | + tar -C aarch64 -zxf fr.centralesupelec.edf.riseclipse.iec61850.rcp.product-macosx.cocoa.aarch64.tar.gz |
| 157 | + rm fr.centralesupelec.edf.riseclipse.iec61850.rcp.product-macosx.cocoa.aarch64.tar.gz |
| 158 | +
|
| 159 | + - name: Build macOS x86_64 dmg |
| 160 | + uses: L-Super/create-dmg-actions@v1.0.3 |
| 161 | + with: |
| 162 | + dmg_name: 'RiseClipse_IEC61850_Application_x86_64' |
| 163 | + src_dir: 'x86_64/RiseClipse_IEC61850_Application.app' |
| 164 | + |
| 165 | + - name: Build macOS aarch64 dmg |
| 166 | + uses: L-Super/create-dmg-actions@v1.0.3 |
| 167 | + with: |
| 168 | + dmg_name: 'RiseClipse_IEC61850_Application_aarch64' |
| 169 | + src_dir: 'aarch64/RiseClipse_IEC61850_Application.app' |
| 170 | + |
| 171 | + - name: upload dmg |
| 172 | + uses: actions/upload-artifact@v4 |
| 173 | + with: |
| 174 | + name: macos-dmg |
| 175 | + path: ./*.dmg |
| 176 | + compression-level: 0 |
| 177 | + overwrite: true |
| 178 | + |
| 179 | + deploy-rcp: |
| 180 | + # Use a specific version to avoid unattended changes with latest |
| 181 | + runs-on: ubuntu-24.04 |
| 182 | + name: Deploy rcp products |
| 183 | + needs: [build-products, build-dmg] |
| 184 | + |
| 185 | + steps: |
| 186 | + |
| 187 | + - name: download macos products |
| 188 | + uses: actions/download-artifact@v4 |
| 189 | + with: |
| 190 | + name: macos-dmg |
| 191 | + |
| 192 | + - name: download other products |
| 193 | + uses: actions/download-artifact@v4 |
| 194 | + with: |
| 195 | + name: other-artifacts |
| 196 | + |
| 197 | + - name: Get artifact list |
| 198 | + run: | |
| 199 | + ARTIFACT_LIST="$(ls -m *.tar.gz *.zip *.dmg | tr -d '\n')" |
| 200 | + echo "artifact_list=${ARTIFACT_LIST}" >> $GITHUB_OUTPUT |
| 201 | + ARTIFACT_LIST="$(ls -1 *.tar.gz *.zip *.dmg)" |
| 202 | + echo '<html>' > /tmp/message.html |
| 203 | + echo '<head>' >> /tmp/message.html |
| 204 | + echo '<meta charset="utf-8">' >> /tmp/message.html |
| 205 | + echo '</head>' >> /tmp/message.html |
| 206 | + echo '<body>' >> /tmp/message.html |
| 207 | + echo '<p>The following downloads are available:</p>' >> /tmp/message.html |
| 208 | + echo '<ul>' >> /tmp/message.html |
| 209 | + for ARTIFACT in ${ARTIFACT_LIST} |
| 210 | + do |
| 211 | + echo '<li><a href="https://rise-clipse.pam-retd.fr/front_v2/develop/'"${ARTIFACT}"'">'"${ARTIFACT}"'</a></li>' >> /tmp/message.html |
| 212 | + done |
| 213 | + echo '</ul>' >> /tmp/message.html |
| 214 | + echo '<p></p>' >> /tmp/message.html |
| 215 | + echo '<p>----</p>' >> /tmp/message.html |
| 216 | + echo '<p>The RiseClipse team</p>' >> /tmp/message.html |
| 217 | + echo '</body>' >> /tmp/message.html |
| 218 | + echo '</html>' >> /tmp/message.html |
| 219 | + id: artifacts_metadata |
| 220 | + |
| 221 | + - name: Copy artifacts |
| 222 | + uses: appleboy/scp-action@master |
| 223 | + with: |
| 224 | + host: ${{ secrets.RISECLIPSE_WEB_HOSTNAME }} |
| 225 | + username: ${{ secrets.RISECLIPSE_WEB_USERNAME }} |
| 226 | + key: ${{ secrets.RISECLIPSE_WEB_SSHKEY }} |
| 227 | + passphrase: ${{ secrets.RISECLIPSE_WEB_PASSPHRASE }} |
| 228 | + source: "${{ steps.artifacts_metadata.outputs.artifact_list }}" |
| 229 | + target: develop |
| 230 | + overwrite: true |
| 231 | + |
| 232 | + - name: Send email about this new development version |
| 233 | + uses: dawidd6/action-send-mail@v4 |
| 234 | + with: |
| 235 | + server_address: smtp.gmail.com |
| 236 | + # Server port, default 25: |
| 237 | + server_port: 465 |
| 238 | + # Optional whether this connection use TLS (default is true if server_port is 465) |
| 239 | + secure: true |
| 240 | + # Optional (recommended) mail server username: |
| 241 | + username: ${{ secrets.RISECLIPSE_GMAIL_USERNAME }} |
| 242 | + # Optional (recommended) mail server password: |
| 243 | + password: ${{ secrets.RISECLIPSE_GMAIL_PASSWORD }} |
| 244 | + # Required mail subject: |
| 245 | + subject: New development version of "RiseClipse IEC61850 Application" |
| 246 | + # Required recipients' addresses: |
| 247 | + to: dominique.marcadet@centralesupelec.fr, aurelie.dehouck-neveu@edf.fr |
| 248 | + # Required sender full name (address can be skipped): |
| 249 | + from: riseclipse@gmail.com |
| 250 | + # Optional HTML body read from file: |
| 251 | + html_body: file:///tmp/message.html |
| 252 | + |
0 commit comments