Skip to content

Commit 450d9da

Browse files
committed
Bump the version of manuForma when committing to main and before deploying
1 parent 3dce023 commit 450d9da

File tree

2 files changed

+21
-33
lines changed

2 files changed

+21
-33
lines changed

.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 deploy-resources
31-
if: matrix.os == 'ubuntu-latest' && matrix.jdk == '8'
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: deploy-resources
35-
path: target/classes/deploy-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 deploy-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: deploy-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

pom.xml

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

267267
<profile>
268-
<!-- NOTE(AR) Build the scripts needed for use in CI -->
269-
<id>deploy-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>

0 commit comments

Comments
 (0)