Compare commits
54 commits
Author | SHA1 | Date | |
---|---|---|---|
b3e7810b5e | |||
|
c4ac52c535 | ||
6cfcec5168 | |||
cd7aa81a8a | |||
ed76ddb28d | |||
|
26f007fee5 | ||
400b4d70da | |||
7bdf8f1f61 | |||
c9724c0864 | |||
b44f3c6526 | |||
fb84ee7a0b | |||
71dd64f71b | |||
da934949c2 | |||
ee1032a6b6 | |||
a8cf628dc8 | |||
86f5b35ef2 | |||
16243f7485 | |||
b350c20172 | |||
3ec8a32b60 | |||
7bc8a41278 | |||
53808ae657 | |||
08acf6949c | |||
02a5fac535 | |||
0c12aaeafe | |||
6060a7d85a | |||
508662ee86 | |||
fb8856f35e | |||
511e09fb86 | |||
0cd637fb20 | |||
a27d2b6991 | |||
73c203502c | |||
942ea9adc6 | |||
ef24c21df4 | |||
cb96a7c37a | |||
3c55e5531b | |||
28dfa150b5 | |||
bff8b4db76 | |||
a6fc675dca | |||
84a56499a9 | |||
18b3a32ac0 | |||
f6507cf82e | |||
d1801774c0 | |||
f6267abdd5 | |||
8f3ddcae10 | |||
579ab99e08 | |||
a223d77e93 | |||
74341f28e7 | |||
f265687fcc | |||
563be82cb3 | |||
38b91df37c | |||
f1b137c8a2 | |||
e113dd6d9e | |||
2fbac46c2e | |||
|
39892ceb24 |
10 changed files with 162 additions and 26 deletions
|
@ -2,6 +2,13 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
|
||||
https://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<!--
|
||||
Configured in docker-container with mappend volume 'maven-cache:/maven-repo',
|
||||
and then, in release.yml STEP 'Build backend (Spring Boot)' with 'volumes:- docker-forgejo_maven-cache:/root/.m2'
|
||||
|
||||
<localRepository>/root/.m2/repository</localRepository>
|
||||
-->
|
||||
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>nexus</id>
|
||||
|
|
|
@ -14,7 +14,7 @@ jobs:
|
|||
- name: Install system dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y nodejs npm openjdk-17-jdk maven git
|
||||
apt-get install -y nodejs npm openjdk-17-jdk maven git jq
|
||||
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac))))
|
||||
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
|
||||
|
||||
|
@ -53,6 +53,106 @@ jobs:
|
|||
git commit -am "Release ${{ steps.version.outputs.release_version }}"
|
||||
git push
|
||||
|
||||
# Create the release notes (closed issues)
|
||||
# Must be here, before the new tag, to get closed issued from the LAST TAG to NOW
|
||||
- name: Generate release notes from closed issues
|
||||
id: generate_notes
|
||||
run: |
|
||||
REPO_OWNER="root"
|
||||
REPO_NAME="resilient"
|
||||
TOKEN="${{ secrets.FORGEJO_TOKEN }}"
|
||||
VERSION="${{ steps.version.outputs.release_version }}"
|
||||
API_BASE="https://git.oguerreiro.com/api/v1"
|
||||
|
||||
# Step 1. Get the latest tag
|
||||
echo "Step 1 : Fetching latest release tag..."
|
||||
LATEST_TAG=$(curl -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/tags" \
|
||||
| jq -r '.[0].name')
|
||||
|
||||
if [[ -z "$LATEST_TAG" || "$LATEST_TAG" == "null" ]]; then
|
||||
# Doesn't have tag. Its the first release
|
||||
echo "No previous tags found. Assuming first release."
|
||||
CLOSED_ISSUES=""
|
||||
else
|
||||
# Tag found
|
||||
echo "Latest tag is: $LATEST_TAG"
|
||||
|
||||
# Step 2: Get the tag ref object
|
||||
echo "Step 2 : Fetch tag ref object from tag = $LATEST_TAG"
|
||||
TAG_REF=$(curl -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/refs/tags/$LATEST_TAG")
|
||||
echo "... TAG_REF is: $TAG_REF"
|
||||
|
||||
# Extract the first .object.sha (if it's an array) or directly if it's an object
|
||||
if echo "$TAG_REF" | jq -e 'type == "array"' >/dev/null; then
|
||||
echo "... is an array"
|
||||
TAG_OBJECT_SHA=$(echo "$TAG_REF" | jq -r '.[0].object.sha')
|
||||
TAG_OBJECT_TYPE=$(echo "$TAG_REF" | jq -r '.[0].object.type')
|
||||
else
|
||||
echo "... is an object"
|
||||
TAG_OBJECT_SHA=$(echo "$TAG_REF" | jq -r '.object.sha')
|
||||
TAG_OBJECT_TYPE=$(echo "$TAG_REF" | jq -r '.object.type')
|
||||
fi
|
||||
|
||||
echo "... TAG SHA is (1): $TAG_OBJECT_SHA"
|
||||
echo "... TAG TYPE is (1): $TAG_OBJECT_TYPE"
|
||||
|
||||
# Resolve annotated tag to commit SHA
|
||||
while [ "$TAG_OBJECT_TYPE" != "commit" ]; do
|
||||
echo "..."
|
||||
echo "... TAG OBJECT is not of type commit. Try : $API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/$TAG_OBJECT_TYPE/$TAG_OBJECT_SHA"
|
||||
TAG_OBJECT=$(curl -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/tags/$TAG_OBJECT_SHA")
|
||||
|
||||
if echo "$TAG_OBJECT" | jq -e 'type == "array"' >/dev/null; then
|
||||
echo "... ... is an array"
|
||||
TAG_OBJECT_SHA=$(echo "$v" | jq -r '.[0].object.sha')
|
||||
TAG_OBJECT_TYPE=$(echo "$TAG_OBJECT" | jq -r '.[0].object.type')
|
||||
else
|
||||
echo "... ... is an object"
|
||||
TAG_OBJECT_SHA=$(echo "$TAG_OBJECT" | jq -r '.object.sha')
|
||||
TAG_OBJECT_TYPE=$(echo "$TAG_OBJECT" | jq -r '.object.type')
|
||||
fi
|
||||
|
||||
echo "... TAG_OBJECT_SHA is (2): $TAG_OBJECT_SHA"
|
||||
echo "... TAG_OBJECT_TYPE is (2): $TAG_OBJECT_TYPE"
|
||||
done
|
||||
|
||||
echo "... commit found with SHA $TAG_OBJECT_SHA"
|
||||
COMMIT_SHA=$TAG_OBJECT_SHA
|
||||
|
||||
# Step 3: Get the commit date
|
||||
echo "Step 3 : Get the commit date from commit = $COMMIT_SHA"
|
||||
COMMIT_DATE=$(curl -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/commits/$COMMIT_SHA" \
|
||||
| jq -r '.commit.committer.date')
|
||||
echo "... Fetching closed issues since $COMMIT_DATE..."
|
||||
|
||||
CLOSED_ISSUES_JSON=$(curl -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/issues?state=closed&since=$COMMIT_DATE")
|
||||
|
||||
if [[ -z "$CLOSED_ISSUES_JSON" ]]; then
|
||||
echo "Warning: No closed issues or invalid response."
|
||||
CLOSED_ISSUES=""
|
||||
else
|
||||
CLOSED_ISSUES=$(echo "$CLOSED_ISSUES_JSON" | jq -r '.[] | "- [#\(.number)](\(.html_url)) \(.title)"')
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build release notes markdown
|
||||
{
|
||||
echo "## Release v$VERSION"
|
||||
echo
|
||||
if [[ -n "$CLOSED_ISSUES" ]]; then
|
||||
echo "### Closed Issues"
|
||||
echo "$CLOSED_ISSUES"
|
||||
else
|
||||
echo "No issues closed since last release."
|
||||
fi
|
||||
} > release-notes.md
|
||||
cat release-notes.md
|
||||
|
||||
- name: Tag release
|
||||
run: |
|
||||
git tag -a v${{ steps.version.outputs.release_version }} -m "Release ${{ steps.version.outputs.release_version }}"
|
||||
|
@ -62,43 +162,36 @@ jobs:
|
|||
|
||||
# Install @Angular dependencies
|
||||
- name: Install frontend dependencies
|
||||
if: false # DISABLED for testing. To check if backend build is also doing frontend.
|
||||
run: |
|
||||
cd src/main/webapp
|
||||
npm ci
|
||||
|
||||
# Setup node_modules cache, for better performance
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
key: node-modules-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
node-modules-
|
||||
|
||||
# Build the frontend
|
||||
- name: Build frontend
|
||||
if: false # DISABLED for testing. To check if backend build is also doing frontend.
|
||||
run: |
|
||||
cd src/main/webapp
|
||||
npm run build
|
||||
|
||||
# Setup Maven cache, for better performance
|
||||
- name: Cache Maven dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
maven-${{ runner.os }}-
|
||||
|
||||
|
||||
# Build the backend (JAR). NOTE: the -Dmaven.download.parallel=false will force MAVEN to have a single connection for downloads, without this I can get "Connection reset"
|
||||
- name: Build backend (Spring Boot)
|
||||
run: |
|
||||
mvn clean package -Pprod -DskipTests -Dmaven.download.parallel=false -s .forgejo/workflows/ci-settings.xml
|
||||
echo "DEBUG Outputs ************************* "
|
||||
echo "Container hostname: $(hostname)"
|
||||
echo "Runner working dir: $PWD"
|
||||
echo "Runner user: $(whoami)"
|
||||
echo "Listing contents of ~/.m2/repository:"
|
||||
ls -lhR ~/.m2/repository | head -n 100 || echo "No .m2/repository found"
|
||||
echo "Disk usage:"
|
||||
du -sh ~/.m2/repository || echo "No .m2 directory found"
|
||||
echo " "
|
||||
echo "BUILD Outputs ************************* "
|
||||
mvn clean package -Pprod -DskipTests -Dmaven.download.parallel=false -Dmaven.repo.local=/root/.m2/repository -s .forgejo/workflows/ci-settings.xml
|
||||
container:
|
||||
image: maven:3.9-eclipse-temurin-17
|
||||
volumes:
|
||||
- /maven-repo:/root/.m2
|
||||
- docker-forgejo_maven-cache:/root/.m2
|
||||
|
||||
# Log output
|
||||
- name: List output files
|
||||
|
@ -112,6 +205,38 @@ jobs:
|
|||
name: app-backend
|
||||
path: target/resilient*.jar
|
||||
|
||||
# Create the release
|
||||
# NOTE: added system dependency install "jq"
|
||||
- name: Create release and upload JAR
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.release_version }}
|
||||
API="https://git.oguerreiro.com/api/v1"
|
||||
REPO="root/resilient"
|
||||
|
||||
# Create release
|
||||
RESPONSE=$(curl -X POST "$API/repos/$REPO/releases" \
|
||||
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"tag_name\": \"v$VERSION\",
|
||||
\"target_commitish\": \"master\",
|
||||
\"name\": \"Release v$VERSION\",
|
||||
\"body\": $(jq -Rs < release-notes.md)
|
||||
}")
|
||||
|
||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||
echo "Created release ID: $RELEASE_ID"
|
||||
|
||||
# Upload artifact
|
||||
# NOTE: For safety, the artifact to upload is expected to be the EXACT $VERSION of this branch. If not, something is wrong.
|
||||
JAR_FILE=$(ls target/resilient-$VERSION.jar | head -n 1)
|
||||
echo "Attaching file : $JAR_FILE"
|
||||
curl -X POST "$API/repos/$REPO/releases/$RELEASE_ID/assets?name=resilient-$VERSION.jar" \
|
||||
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||
-H "Content-Type: application/java-archive" \
|
||||
--data-binary @"$JAR_FILE"
|
||||
|
||||
|
||||
# ##################################################################
|
||||
# ## THIS IS A RELEASE - Change master version to next SNAPSHOT ##
|
||||
# ## #4. Checkout master ##
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -5,7 +5,7 @@
|
|||
|
||||
<groupId>com.oguerreiro.resilient</groupId>
|
||||
<artifactId>resilient</artifactId>
|
||||
<version>1.0.5-SNAPSHOT</version>
|
||||
<version>1.0.8-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>Resilient</name>
|
||||
<description>Description for Resilient</description>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<!-- TOP BANNER -->
|
||||
<section>
|
||||
<div class="container-fluid mb-5 p-0">
|
||||
<img id="home-header" src="content/images/home_banner.jpg" class="img-fluid" alt="Route Zero">
|
||||
<div class="container-fluid mb-5 p-0 position-relative">
|
||||
<img id="home-header" src="content/images/home_banner.jpg" alt="Route Zero" class="img-fluid w-100">
|
||||
|
||||
<span class="position-absolute bottom-0 start-0 text-white p-3 fs-4 title">
|
||||
InNOVA NOVA Information System on Environment and Sustainability
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
BIN
src/main/webapp/content/images/Graphic1_2024.png
Normal file
BIN
src/main/webapp/content/images/Graphic1_2024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 139 KiB |
BIN
src/main/webapp/content/images/Graphic2_2024.png
Normal file
BIN
src/main/webapp/content/images/Graphic2_2024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
BIN
src/main/webapp/content/images/Graphic3_2024.png
Normal file
BIN
src/main/webapp/content/images/Graphic3_2024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
src/main/webapp/content/images/Graphic4_2024.png
Normal file
BIN
src/main/webapp/content/images/Graphic4_2024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
BIN
src/main/webapp/content/images/Graphic_gases_2024.png
Normal file
BIN
src/main/webapp/content/images/Graphic_gases_2024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
BIN
src/main/webapp/content/images/Graphic_missoes_globais_2024.png
Normal file
BIN
src/main/webapp/content/images/Graphic_missoes_globais_2024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 103 KiB |
Loading…
Add table
Add a link
Reference in a new issue