Skip to content

Commit e975119

Browse files
authored
Merge pull request majlis-erc#788 from evolvedbinary/feature/ci-bump-version
Bump the version of manuForma when committing to main and before deploying
2 parents b352531 + ee0b1a3 commit e975119

7 files changed

Lines changed: 26 additions & 38 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os: [ubuntu-latest, macos-latest, windows-latest]
11-
jdk: [8,11,17,21]
11+
jdk: [11,17,21,25]
1212
runs-on: ${{ matrix.os }}
1313
steps:
1414
- uses: actions/checkout@v4
@@ -17,59 +17,53 @@ jobs:
1717
with:
1818
distribution: 'liberica'
1919
java-version: ${{ matrix.jdk }}
20-
- run: mvn clean package
20+
- name: Build, Test, and Package
21+
run: mvn clean package
2122
- name: Persist built XAR
22-
if: matrix.os == 'ubuntu-latest' && matrix.jdk == '8'
23+
if: matrix.os == 'ubuntu-latest' && matrix.jdk == '11' && github.ref != 'refs/heads/main'
2324
uses: actions/upload-artifact@v4
2425
with:
2526
name: xar
2627
path: target/manuforma-*.xar
2728
if-no-files-found: error
2829
retention-days: 1
2930
overwrite: true
30-
- name: Persist built ci-resources
31-
if: matrix.os == 'ubuntu-latest' && matrix.jdk == '8'
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: ci-resources
35-
path: target/classes/ci-resources/*
36-
if-no-files-found: error
37-
retention-days: 1
38-
overwrite: true
3931

40-
deploy:
32+
deploy-staging:
4133
if: github.ref == 'refs/heads/main'
4234
needs: build
4335
name: Deploy
4436
runs-on: ubuntu-latest
4537
environment: manuforma-staging
4638
steps:
47-
- name: Retrieve built XAR
48-
uses: actions/download-artifact@v4
49-
with:
50-
name: xar
51-
- name: Retrieve built ci-resources
52-
uses: actions/download-artifact@v4
39+
- uses: actions/checkout@v4
40+
- name: Setup Java
41+
uses: actions/setup-java@v4
5342
with:
54-
name: ci-resources
55-
- name: Set scripts as executable
56-
run: chmod +x upload-remote-tmp-xar.sh redeploy-xar-package.sh delete-remote-tmp-xar.sh
43+
distribution: 'liberica'
44+
java-version: 11
45+
- name: Bump Version Number
46+
run: mvn versions:set -DnewVersion="$(date -u '+%Y.%m.%d').$(git rev-parse --short HEAD)"
47+
- name: Build Deploy Scripts and Package
48+
run: mvn package -DskipTests -Pbuild-deploy-scripts
49+
- name: Set Deploy Scripts as executable
50+
run: chmod +x target/classes/deploy-resources/upload-remote-tmp-xar.sh target/classes/deploy-resources/redeploy-xar-package.sh target/classes/deploy-resources/delete-remote-tmp-xar.sh
5751
- name: Upload temp XAR to Remote Database Server
5852
env:
5953
REMOTE_EDB_SERVER_USERNAME: ${{ secrets.REMOTE_EDB_SERVER_USERNAME }}
6054
REMOTE_EDB_SERVER_PASSWORD: ${{ secrets.REMOTE_EDB_SERVER_PASSWORD }}
6155
REMOTE_EDB_SERVER_URL: ${{ secrets.REMOTE_EDB_SERVER_URL }}
62-
run: ./upload-remote-tmp-xar.sh
56+
run: target/classes/deploy-resources/upload-remote-tmp-xar.sh
6357
- name: Redeploy XAR on Remote Database Server
6458
env:
6559
REMOTE_EDB_SERVER_USERNAME: ${{ secrets.REMOTE_EDB_SERVER_USERNAME }}
6660
REMOTE_EDB_SERVER_PASSWORD: ${{ secrets.REMOTE_EDB_SERVER_PASSWORD }}
6761
REMOTE_EDB_SERVER_URL: ${{ secrets.REMOTE_EDB_SERVER_URL }}
68-
run: ./redeploy-xar-package.sh
62+
run: target/classes/deploy-resources/redeploy-xar-package.sh
6963
- name: Delete temp XAR from Remote Database Server
7064
env:
7165
REMOTE_EDB_SERVER_USERNAME: ${{ secrets.REMOTE_EDB_SERVER_USERNAME }}
7266
REMOTE_EDB_SERVER_PASSWORD: ${{ secrets.REMOTE_EDB_SERVER_PASSWORD }}
7367
REMOTE_EDB_SERVER_URL: ${{ secrets.REMOTE_EDB_SERVER_URL }}
74-
run: ./delete-remote-tmp-xar.sh
68+
run: target/classes/deploy-resources/delete-remote-tmp-xar.sh
7569

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# manuForma [BETA]
22

33
[![Build Status](https://github.com/majlis-erc/manuForma/actions/workflows/ci.yml/badge.svg)](https://github.com/majlis-erc/manuForma/actions/workflows/ci.yml)
4-
[![Java 8+](https://img.shields.io/badge/java-8+-blue.svg)](https://bell-sw.com/pages/downloads/)
4+
[![Java 11+](https://img.shields.io/badge/java-11+-blue.svg)](https://bell-sw.com/pages/downloads/)
55
[![DOI](https://zenodo.org/badge/474991717.svg)](https://zenodo.org/badge/latestdoi/474991717)
66

77
The manuForma application is designed to make TEI data creation and distributed editing faster and easier. The application features easy to use multi-step forms, Github interactions and more.
@@ -58,7 +58,7 @@ To build the form you will simply need to run the XSLT, it will use the values d
5858
The manuForma application can be compiled into an EXPath Package for deployment to an Elemental (or eXist-db) server.
5959

6060
Build Requirements:
61-
* [Java JDK](https://bell-sw.com/pages/downloads/) version 8 (or newer)
61+
* [Java JDK](https://bell-sw.com/pages/downloads/) version 11 (or newer)
6262

6363
To build the manuForma application:
6464

@@ -105,7 +105,7 @@ docker volume create manuforma-database
105105
Once you have built (or obtained) the Docker Image, you can run manuForma in Docker like so:
106106

107107
```shell
108-
docker run -it -p 8080:8080 --mount type=volume,src=manuforma-database,dst=/elemental/data majlis/manuforma:latest
108+
docker run -it -p 8080:8080 --mount type=volume,src=manuforma-database,dst=/elemental/data majlis-erc/manuforma:latest
109109
```
110110

111111
manuForma will then be available in your web-browser at `http://localhost:8080/exist/apps/manuForma/index.html`

pom.xml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -265,20 +265,14 @@
265265
</profile>
266266

267267
<profile>
268-
<!-- NOTE(AR) Build the scripts needed for use in CI -->
269-
<id>ci-resources</id>
270-
<activation>
271-
<property>
272-
<name>env.CI</name>
273-
<value>true</value>
274-
</property>
275-
</activation>
268+
<!-- NOTE(AR) Build the scripts needed to deploy to the server -->
269+
<id>build-deploy-scripts</id>
276270
<build>
277271
<resources>
278272
<resource>
279-
<directory>src/main/ci-resources</directory>
273+
<directory>src/main/deploy-resources</directory>
280274
<filtering>true</filtering>
281-
<targetPath>ci-resources</targetPath>
275+
<targetPath>deploy-resources</targetPath>
282276
</resource>
283277
</resources>
284278
</build>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)