Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
25bc3d5
fix: tsc build error
geck1942 May 7, 2025
64ed285
test: ✅ JEST integration
geck1942 May 8, 2025
9cd1961
Merge pull request #1 from superhuit-agency/main
geck1942 May 8, 2025
ec693eb
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
3797947
Merge branch 'develop' of github.com:superhuit-agency/superstack_test…
geck1942 May 12, 2025
93b0a18
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
1af96ab
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
a6a4c2d
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
6dfad0f
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
ef11093
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
2e17f84
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
9d4cdb2
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
ab976f2
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
17c2ebe
CI: 🧑‍🔧 testing CI deployment
geck1942 May 12, 2025
b6de6c2
CI: 🧑‍🔧 testing CI deployment
geck1942 May 13, 2025
b53d22f
CI: 🧑‍🔧 testing CI deployment
geck1942 May 13, 2025
58bec32
CI: 🧑‍🔧 testing CI deployment
geck1942 May 13, 2025
0ad52b5
CI: 🧑‍🔧 testing CI deployment
geck1942 May 13, 2025
65622f4
CI: 🧑‍🔧 testing CI deployment
geck1942 May 13, 2025
ee08285
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
eacf994
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
cf84ced
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
f499af5
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
6aa1a54
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
5da318a
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
89b5dc4
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
48eeff7
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
dd59905
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
63e8ba5
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
a12f8bc
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
3b9a82f
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
8f22138
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
175f181
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
e5e3ea6
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
6ca69a3
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
d724837
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
5b6d381
CI: 🧑‍🔧 testing CI deployment
geck1942 May 14, 2025
2f70861
CI: 🧑‍🔧 testing CI deployment
geck1942 May 15, 2025
2f421d7
CI: 🧑‍🔧 testing CI deployment
geck1942 May 15, 2025
8f88c26
CI: 🧑‍🔧 testing CI deployment
geck1942 May 15, 2025
0a0919d
CI: 🧑‍🔧 testing CI deployment
geck1942 May 15, 2025
5df8f02
CI: 🧑‍🔧 workflow update
geck1942 May 17, 2025
fe4137f
Merge branch 'develop' of github.com:superhuit-agency/superstack_test…
geck1942 May 17, 2025
7922461
CI: 🧑‍🔧 automated github workflows
geck1942 May 19, 2025
0c07dc8
CI: 🧑‍🔧 fixing some env vars for develop
geck1942 May 19, 2025
1e32e15
CI: 🧑‍🔧 fixing some env vars for develop
geck1942 May 19, 2025
35f9019
CI: 🧑‍🔧 fixing some env vars for develop
geck1942 May 19, 2025
09eb884
CI: 🧑‍🔧 restored WORDPRESS_PATH variable
geck1942 May 19, 2025
970c9f7
CI: 🧑‍🔧 fixing some env vars for develop
geck1942 May 19, 2025
8ea2c00
CI: 🧑‍🔧 fixing some env vars for develop
geck1942 May 19, 2025
9d6e9d2
CI: 🧑‍🔧 fixing some env vars for develop
geck1942 May 19, 2025
d836cfb
feat: Automated tests and github workflows
geck1942 May 19, 2025
212db37
ship: 🚀 upgrade to version 1.1.0
tech-superhuit May 19, 2025
ee9e0e1
TEST: dummy
geck1942 May 19, 2025
bdd4914
Merge branch 'main' into develop
geck1942 May 19, 2025
13ca02e
missing version
geck1942 May 19, 2025
6fbf471
Merge branch 'develop' of github.com:superhuit-agency/superstack_test…
geck1942 May 19, 2025
31ce98b
guthub develop PR workflow + actions
geck1942 May 19, 2025
5311aac
ship: 🚀 upgrade to version 1.1.1
tech-superhuit May 19, 2025
2f6211e
CI: 🧑‍🔧 auto WP update
geck1942 May 19, 2025
0062166
CI: 🧑‍🔧 auto WP update
geck1942 May 19, 2025
f6b8477
CI: 🧑‍🔧 auto WP update
geck1942 May 19, 2025
4caa219
CI: 🧑‍🔧 auto WP update
geck1942 May 19, 2025
a3b372f
CI: 🧑‍🔧 variables names and documentation
geck1942 May 19, 2025
81b77ca
feat: JEST config for Typescript
geck1942 May 27, 2025
3e49ecd
feat: ✨ first tests
geck1942 May 28, 2025
4159c8c
feat: ✨ atoms components tests
geck1942 Jun 2, 2025
c2c8d99
Merge remote-tracking branch 'origin/main' into develop
geck1942 Jun 2, 2025
564a4d8
feat: ✨ endtoend components test
geck1942 Jun 3, 2025
9f8e73f
fix: build issue
geck1942 Jun 3, 2025
b558313
build: run tsc first
geck1942 Jun 3, 2025
aba1569
build: run tsc first
geck1942 Jun 3, 2025
34e27c5
undo: tsc
geck1942 Jun 3, 2025
9f295b3
build: fixed typescript compilation error.
geck1942 Jun 3, 2025
72461db
build: new git actions + env vars support
geck1942 Jun 3, 2025
f826737
build: fixed typescript compilation error.
geck1942 Jun 8, 2025
7c1e8f1
build: handles chrome actions in git
geck1942 Jun 8, 2025
e40f87c
fix: build issue
geck1942 Jun 8, 2025
07f1103
build: new git actions + env vars support
geck1942 Jun 8, 2025
7101b31
Added some unit tests
geck1942 Jun 8, 2025
41fb1f6
build: new git actions + env vars support
geck1942 Jun 8, 2025
3529a82
ci: new workflow
geck1942 Jun 8, 2025
b33adea
Merge branch 'main' of github.com:superhuit-agency/superstack_test
geck1942 Jun 8, 2025
059b599
ship: 🚀 upgrade to version 1.1.2
tech-superhuit Jun 8, 2025
35d4e9f
ci: new workflow
geck1942 Jun 8, 2025
5e3ed0d
Merge branch 'main' of github.com:superhuit-agency/superstack_test
geck1942 Jun 8, 2025
9665c03
ship: 🚀 upgrade to version 1.1.3
tech-superhuit Jun 8, 2025
3b8a1ec
ci: new workflow fixes
geck1942 Jun 8, 2025
ed74672
Merge branch 'main' of github.com:superhuit-agency/superstack_test
geck1942 Jun 8, 2025
7235dd0
ship: 🚀 upgrade to version 1.1.4
tech-superhuit Jun 8, 2025
1bf07e3
Merge branch 'main' into develop
geck1942 Jun 8, 2025
cbefdc3
ci: tests timeouts
geck1942 Jun 8, 2025
f35ce41
ci: video logs for tests!
geck1942 Jun 9, 2025
3e0008b
ci: fix for video tests
geck1942 Jun 9, 2025
5fad877
ci: more fix for video tests
geck1942 Jun 9, 2025
9a20568
ci: 🧑‍🔧 workflow tests upgrade
geck1942 Jun 9, 2025
f49fdfa
ci: 🧑‍🔧 faster + cleaner tests
geck1942 Jun 9, 2025
6b77880
ci: 🧑‍🔧 more test fixes
geck1942 Jun 9, 2025
82af9f1
ci: 🧑‍🔧 more test fixes
geck1942 Jun 9, 2025
e898595
ci: 🧑‍🔧 added tests after deploy
geck1942 Jun 9, 2025
c67892b
ci: 🧑‍🔧 code refactor for tests in workflows
geck1942 Jun 9, 2025
751e398
ci: merged workflows from develop
geck1942 Jun 9, 2025
d8a4d56
ship: 🚀 upgrade to version 1.1.5
tech-superhuit Jun 9, 2025
ceaf1a2
ci: dummy test
geck1942 Jun 9, 2025
c3e3c09
ci: 🧑‍🔧 code fix for tests in workflows
geck1942 Jun 9, 2025
1495fee
ci: 🧑‍🔧 code fix for tests in workflows
geck1942 Jun 9, 2025
75c55e9
ci: 🧑‍🔧 code fix for tests in workflows
geck1942 Jun 9, 2025
8ba7938
ci: 🧑‍🔧 code fix for tests in workflows
geck1942 Jun 9, 2025
d63008c
ci: 🧑‍🔧 code fix for tests in workflows
geck1942 Jun 10, 2025
9280f79
Merge remote-tracking branch 'origin/main' into develop
geck1942 Jun 10, 2025
6267283
ci: 🧑‍🔧 code fix for tests in workflows
geck1942 Jun 10, 2025
cefb032
ci: 🧑‍🔧 code fix for tests in workflows
geck1942 Jun 10, 2025
a5a3aa8
ship: 🚀 upgrade to version 1.1.6
tech-superhuit Jun 10, 2025
96f44f5
ci: 🧑‍🔧 configs cleanup
geck1942 Jun 16, 2025
e75b515
Merge branch 'develop'
geck1942 Jun 16, 2025
357e7ca
ship: 🚀 upgrade to version 1.0.1
tech-superhuit Jun 16, 2025
20701ed
fix: 🐛 replaced pupeteer by ffmpeg
geck1942 Jul 24, 2025
d8c63b3
Merge branch 'main' of github.com:superhuit-agency/superstack_test
geck1942 Jul 24, 2025
07414d0
fix: 🐛 typescript + build fixes
geck1942 Jul 24, 2025
ed38931
tests: Changed the architecture of tests + stories
geck1942 Jul 28, 2025
02157c9
ship: 🚀 upgrade to version 1.0.2
tech-superhuit Jul 28, 2025
36f81ba
tests: config update
geck1942 Jul 28, 2025
6099e1a
Merge branch 'main' of github.com:superhuit-agency/superstack_test
geck1942 Jul 28, 2025
e71ae4e
ship: 🚀 upgrade to version 1.0.3
tech-superhuit Jul 28, 2025
f0a2aca
ci: updated changelog workflow
geck1942 Jul 28, 2025
f5c6a04
ship: 🚀 upgrade to version 1.0.4
tech-superhuit Jul 28, 2025
02062d9
ci: updated changelog workflow
geck1942 Jul 28, 2025
208084c
ship: 🚀 upgrade to version 1.0.5
tech-superhuit Jul 28, 2025
dda8d2d
ci: updated changelog workflow
geck1942 Jul 28, 2025
2eb0bdb
ship: 🚀 upgrade to version 1.0.6
tech-superhuit Jul 28, 2025
bda559e
ci: reverted version numbers after tests
geck1942 Jul 28, 2025
e60c254
ship: 🚀 upgrade to version 1.0.1
tech-superhuit Jul 28, 2025
b90cec1
update: cleaned environement example files
geck1942 Jul 28, 2025
8845e23
ship: 🚀 upgrade to version 1.0.2
tech-superhuit Jul 28, 2025
b445aa0
updated changelog
geck1942 Jul 28, 2025
abddb0a
updated versions numbers
geck1942 Jul 28, 2025
2e2239c
ship: 🚀 upgrade to version 1.1.1
tech-superhuit Jul 28, 2025
84ec31e
rolledback version to v1.0.0 before auto-update
geck1942 Jul 28, 2025
0f134c4
ship: 🚀 upgrade to version 1.1.0
tech-superhuit Jul 28, 2025
c0cd14c
feat: :arrow_up: Update WP to 6.8 (fixes #86)
charl0tee Jul 28, 2025
85617a2
update:
geck1942 Jul 28, 2025
fe9097a
Merge branch 'main' of github.com:superhuit-agency/superstack_test
geck1942 Jul 28, 2025
10c97af
restored original version
geck1942 Jul 28, 2025
6470550
restored heading behaviour
geck1942 Jul 28, 2025
80a05c6
cool provision logs
geck1942 Jul 28, 2025
5c722a3
ship: 🚀 upgrade to version 1.1.0
tech-superhuit Jul 28, 2025
e0ebd8d
testing new auto changelog
geck1942 Jul 28, 2025
5d9fd69
ship: 🚀 upgrade to version 1.1.1
tech-superhuit Jul 28, 2025
81b65d0
restored original version
geck1942 Jul 28, 2025
836efa8
ship: 🚀 upgrade to version 1.1.0
tech-superhuit Jul 28, 2025
aea4957
testing documentation + plopfile generators
geck1942 Jul 29, 2025
f32294f
ship: 🚀 upgrade to version 1.1.0
tech-superhuit Jul 29, 2025
8af2282
feat: :arrow_up: Update Node to v22
charl0tee Jul 29, 2025
a0f7f60
fix: :bug: Fix patterns + child blocks in inserter after WP update
charl0tee Jul 29, 2025
1f8637b
fix: :bug: Fixes after MAJ WP to 6.8
charl0tee Jul 29, 2025
62b7163
feat: :arrow_up: Update Next to 15 + React to 19 + all other packages
charl0tee Jul 29, 2025
0674b6a
fix: :bug: Fix Next components inside WP Editor
charl0tee Jul 29, 2025
91fe946
fix: :bug: Fixes innerblocks + lists styling
charl0tee Jul 29, 2025
97dc5fa
fix: :bug: Add Vercel CLI for Vercel deployement
charl0tee Jul 31, 2025
11c57f7
fix: :bug: Fiy block whitelisting => hide them in css from block inse…
charl0tee Jul 31, 2025
4a09879
fix: :bug: Temporary fix :: React incompatibility for Next Image + Li…
charl0tee Jul 31, 2025
dce2f4b
fix: Small fix/upgrade
charl0tee Jul 31, 2025
bba5069
feat: 👩🏽‍💻 Add cache option to fetchAPI params
charl0tee Aug 5, 2025
b015bc6
Update src/lib/fetch-api.ts
charl0tee Aug 6, 2025
f24a080
fix: :label: Fix CardNews typing
charl0tee Aug 6, 2025
556fa7b
refactor: ⚒ move uploads folder volume into .data
kuuak Aug 8, 2025
ed63f6e
ci: 🧑‍🔧 Restored Vercel deployment feature
geck1942 Aug 18, 2025
fc0e6a5
fix: 🐛 removed unused library
geck1942 Aug 18, 2025
ddada9d
Merge branch 'main' of github.com:superhuit-agency/superstack_test
geck1942 Aug 18, 2025
7a9f492
build: 1.1.1 changelog
geck1942 Aug 18, 2025
1271908
ship: 🚀 upgrade to version 1.1.1
tech-superhuit Aug 18, 2025
015aaf1
Merge pull request #6 from superhuit-agency/main
geck1942 Aug 18, 2025
2851878
feat: ⬆️ Update WP to 6.8 (fixes #86)
geck1942 Aug 18, 2025
428ff96
ci: 🧑‍🔧 supports legacy-peer-deps in development
geck1942 Aug 18, 2025
62f4ad4
ci: 🧑‍🔧 added legacy-peer-deps in deployment
geck1942 Aug 18, 2025
b2799f3
build: 🔧 updated package-json.lock
geck1942 Aug 18, 2025
e7e8323
ci: 🧑‍🔧 fix deploy frontend with WORDPRESS_URL
geck1942 Aug 18, 2025
0578ab6
fix: 🐛 use client to call useLocale()
geck1942 Aug 18, 2025
39ac3cc
fix: 🐛 null uri on empty params
geck1942 Aug 18, 2025
f43a558
fix: 🐛 null uri on empty params
geck1942 Aug 18, 2025
b0515fd
fix: 🐛 fix for first-time e2e tests
geck1942 Aug 18, 2025
3fc9ed0
fix: 🐛 updated tests set for WP6.8
geck1942 Aug 19, 2025
e31511e
fix: 🐛 updated tests set for post page
geck1942 Aug 19, 2025
ecd9848
ci: 🧑‍🔧 changed ci .env copy method
geck1942 Aug 19, 2025
6f547ec
ci: 🧑‍🔧 changed ci build call
geck1942 Aug 19, 2025
a8d5828
ci: 🧑‍🔧 added missing var in CI
geck1942 Aug 19, 2025
ee30e8c
ci: 🧑‍🔧 added missing var in CI for theme build
geck1942 Aug 19, 2025
291111c
ci: 🧑‍🔧 supports failed login
geck1942 Aug 19, 2025
b07c85b
ci: 🧑‍🔧 removed warning to pass tests
geck1942 Aug 19, 2025
f0dac95
ci: 🧑‍🔧 fixed preview post during e2e tests
geck1942 Aug 19, 2025
cfc3200
ci: 🧑‍🔧 fixed preview post link during e2e tests
geck1942 Aug 19, 2025
e15439c
ci: 🧑‍🔧 fixed preview post link during e2e tests
geck1942 Aug 19, 2025
2169749
ci: 🧑‍🔧 fixed preview post link during e2e tests
geck1942 Aug 19, 2025
a01045c
ci: 🧑‍🔧 fixed preview post load during e2e tests
geck1942 Aug 19, 2025
a9c1809
ci: 🧑‍🔧 fixed preview post load during e2e tests
geck1942 Aug 19, 2025
920ea32
ci: 🧑‍🔧 fixed preview post in tests
geck1942 Aug 20, 2025
4fdffc0
ci: 🧑‍🔧 fixed preview post to /blog/ in tests
geck1942 Aug 20, 2025
f67e749
ci: 🧑‍🔧 fixed code editor manipulation
geck1942 Aug 20, 2025
b221af4
ci: 🧑‍🔧 updates
geck1942 Aug 20, 2025
6ecab05
Merge branch 'develop' of github.com:superhuit-agency/superstack_test…
geck1942 Aug 20, 2025
5c6ff1b
Merge pull request #8 from superhuit-agency/develop
geck1942 Aug 20, 2025
8ccd529
ship: 🚀 upgrade to version 1.2.0
tech-superhuit Aug 20, 2025
ecaabe8
Merge remote-tracking branch 'remote/release/v1.1.0'
geck1942 Aug 20, 2025
4fd0d4c
ship: 🚀 upgrade to version 1.2.1
tech-superhuit Aug 20, 2025
96d5b37
Merge pull request #83 from superstack_test
geck1942 Aug 20, 2025
2aa429e
fix: 🐛 restored former superstack version 1.0.0
geck1942 Aug 20, 2025
ef48f2e
ci: 🧑‍🔧 Enhanced PR workflows and passing tests 🧪
geck1942 Aug 27, 2025
e8ebc79
ship: 🚀 upgrade to version 1.2.2
tech-superhuit Aug 27, 2025
6f73c58
Merge remote-tracking branch 'remote/release/v1.1.0'
geck1942 Aug 27, 2025
c8f0eee
ship: 🚀 upgrade to version 1.2.0
tech-superhuit Aug 27, 2025
d6a38c8
Merge pull request #97 from superhuit-agency/main
geck1942 Aug 27, 2025
af85e6d
fix: 🐛 restored former superstack version 1.0.0
geck1942 Aug 27, 2025
093bd6f
ci: 🧑‍🔧 removed apt get update for faster workflows
geck1942 Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions .env.github.example

This file was deleted.

16 changes: 16 additions & 0 deletions .env.github.secrets.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Github Token used by Composer to install and download packages
COMPOSER_GITHUB_TOKEN=
# NEXT (frontend) SSH private key used for deployment
NEXT_SSH_PRIVATE_KEY=
# Release belt password used to download custom repositories
RELEASE_BELT_PASSWORD=
# WORDPRESS database password
WORDPRESS_DB_PASSWORD=
# WORDPRESS (backend) SSH private key used for deployment
WORDPRESS_SSH_PRIVATE_KEY=
# Wordpress' admin user password
WORDPRESS_ADMIN_PASSWORD=

## OPTIONAL
# Token for vercel deployment
VERCEL_TOKEN=
38 changes: 38 additions & 0 deletions .env.github.variables.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# NEXT (frontend) SSH params used for deployment
NEXT_SSH_HOST=superhuit.ch
NEXT_SSH_PATH=/var/www/public
NEXT_SSH_PORT=22
NEXT_SSH_USER=superstack
# Frontend URL (no trailing slash)
NEXT_URL=https://superstack.superhuit.dev
# Release belt user used to download custom repositories
RELEASE_BELT_USER=superhuit
# WORDPRESS (backend) admin credentials
WORDPRESS_ADMIN_EMAIL=tech+superstack@superhuit.ch
WORDPRESS_ADMIN_USER=superstack
# WORDPRESS Database credentials
WORDPRESS_DB_HOST=localhost
WORDPRESS_DB_NAME=wordpress_superstack
WORDPRESS_DB_USER=wordpress
# WORDPRESS default locale (follow xx_XX format)
WORDPRESS_LOCALE=fr_FR
# WORDPRESS absolute folder used in the backend (also used by SSH)
WORDPRESS_PATH=/var/www/wordpress
# WORDPRESS SSH params used for deployment
WORDPRESS_SSH_HOST=superhuit.ch
WORDPRESS_SSH_PORT=22
WORDPRESS_SSH_USER=superadmin
# Theme name (should only use alphanumeric characters)
WORDPRESS_THEME_NAME=superstack
# Theme title
WORDPRESS_THEME_TITLE="Superstack by Superhuit"
# Backend URL (without wp-admin, no trailing slash)
WORDPRESS_URL=https://superstack-admin.superhuit.dev
# WORDPRESS Version
WORDPRESS_VERSION=6.5

## OPTIONAL
# Vercel project ID (if set, workflow will prefer Vercel deployment)
VERCEL_PROJECT_ID=
# Vercel Organization ID
VERCEL_ORG_ID=
2 changes: 1 addition & 1 deletion .env.local.example → .env.next.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ NEXT_PUBLIC_HCAPTCHA_KEY=10000000-ffff-ffff-ffff-000000000001 # this is a testin
NEXT_PUBLIC_GTM_KEY=GTM-P7K7K7K7 # Google Tag Manager key

## Secret to authorize revalidation
REVALIDATE_SECRET=37fae9e2-0f35-4c37-8d96-429444ce0e6f
REVALIDATE_SECRET=da272fd1-cd34-437b-95f3-dfd9e53b6766
109 changes: 109 additions & 0 deletions .github/actions/automated/check-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/bin/bash

# Usage: script.sh <path_to_changelog> <last_version> [--version|--desc]

# Check input parameters
if [ "$#" -lt 2 ]; then
echo "Usage: $0 <path_to_changelog> <last_version> [--version|--desc]"
exit 1
fi

changelog_path="$1"
last_version="$2"
mode=$3

# Read the changelog file
if [ ! -f "$changelog_path" ]; then
echo "$changelog_path file was not found or could not be opened."
exit 1
fi

# Initialize variables
new_version_found=false
capture_description=false
description=""

compare_versions() {
# Usage: compare_versions <version1> <version2>
# Outputs: 1 if version1 > version2
# 0 if version1 == version2
# -1 if version1 < version2
awk -v ver1="$1" -v ver2="$2" 'BEGIN {
split(ver1, a, ".");
split(ver2, b, ".");
for (i = 1; i <= length(a) || i <= length(b); i++) {
if (a[i] + 0 < b[i] + 0) {
print -1;
exit;
}
else if (a[i] + 0 > b[i] + 0) {
print 1;
exit;
}
}
print 0;
}'
}

# Read the file line by line
while IFS= read -r line || [[ -n "$line" ]]; do
if [[ $line =~ ^##\ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
# When a version header is found
if $new_version_found; then
# If we found the new version in the previous iteration, stop reading further
break
fi

new_version="${BASH_REMATCH[1]}"

comparison_result=$(compare_versions $new_version $last_version)
if [[ $comparison_result -eq 1 ]]; then
# Start capturing the description for the next version found
new_version_found=true
else
# Stop capturing if this version is less than or equal to the last known version
break
fi
elif $new_version_found; then
# Capture the description lines
description+="$line"$'\n'
fi
done < "$changelog_path"

# Output based on mode
case "$mode" in
"--version")
# Check if a new version was found
if $new_version_found; then
echo "$new_version"
else
echo "patch"
fi
exit 0
;;
"--desc")
# Trim trailing newlines
while [[ "$description" =~ $'\n'$ ]]; do
description="${description%$'\n'}"
done

# Trim leading newlines
while [[ "$description" = $'\n'* ]]; do
description="${description#*$'\n'}"
done
echo "$description"
;;
*)
if [ -n "$mode" ]; then
echo "Invalid option: $mode"
exit 1
fi
# Error of Do nothing if no mode specified
if ! $new_version_found; then
echo "Error - The changelog file doesn't contain any information over $last_version."
exit 1
fi
echo "Success - A changelog entry was found for v$new_version. Good job!"
;;
esac
exit 0
46 changes: 46 additions & 0 deletions .github/actions/automated/git-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Check input parameters
if [ "$#" -lt 4 ]; then
echo "Usage: $0 <repository> <github_token> <version> <changelog_path> [--draft]"
exit 1
fi

# Variables
REPO=$1 # Repo should be the 1st argument
TOKEN=$2 # Pass GitHub token as the second script argument
VERSION=$3 # New version used for the release (excluding the v prefix)
changelogfile=$4 # Path to the changelog to read the description
draft_mode=$5 # Path to the changelog to read the description

# Read the description of last version written in the changelog
DESCRIPTION=$(.github/actions/automated/check-changelog.sh $changelogfile 0.0.0 --desc)

is_draft=false
if [[ "$draft_mode" == "--draft" ]]; then
is_draft=true
fi

# Get the latest merged PR
PR_TITLE=$(curl -H "Authorization: token $TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/$REPO/pulls?state=closed&base=main&sort=updated&direction=desc" \
-s | jq -r '[.[] | select(.merged_at != null)][0].title')

RELEASE_DATA=$(jq -n \
--arg tag "v$VERSION" \
--arg name "v$VERSION - $PR_TITLE" \
--arg body "$DESCRIPTION" \
--argjson draft $is_draft \
'{tag_name: $tag, name: $name, body: $body, draft: $draft}')

curl -H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.github.v3+json" \
-X POST \
-d "$RELEASE_DATA" \
"https://api.github.com/repos/$REPO/releases"

echo "A draft release for v$VERSION was sent to $REPO with the following content:"
echo "$PR_TITLE"
echo "$DESCRIPTION"
75 changes: 75 additions & 0 deletions .github/actions/automated/increment-semver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash
file_path=$1
version_type=$2
output_version=false

# Check for arguments
for arg in "$@"
do
case $arg in
--out)
output_version=true
;;
--help)
echo "Usage: $0 filepath {major|minor|patch|self|x.x.x} [--out]"
exit 0
;;
*)
# Ignore unknown arguments
;;
esac
done

# Extract the current version using awk
current_version=$(awk -F'"' '/"version":/ {print $4; exit}' $file_path)

if [ -z "$current_version" ]; then
echo "Version not found in $file_path"
exit 1
fi

# Break the version number into major, minor, and patch
IFS='.' read -r major minor patch <<< "$current_version"

# Increment version based on the specified type
# Construct the new version
new_version="$version_type"
case $version_type in
self)
new_version="$major.$minor.$patch"
;;
major)
new_version="$((major + 1)).0.0"
;;
minor)
new_version="$major.$((minor + 1)).0"
;;
patch)
new_version="$major.$minor.$((patch + 1))"
;;
esac

if $output_version; then
echo "$new_version"
exit 0
else
echo "Updating $file_path version from $current_version to: $new_version"
fi

# Update composer.json with the new version using sed
# Using sed with proper handling for both macOS and Linux environments
# macOS requires an empty string with the -i option
# Be careful, only replace the first occurence at the top of the file
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "1,/\"version\": \"$current_version\"/ s/\"version\": \"$current_version\"/\"version\": \"$new_version\"/1" $file_path
else
# Linux does not require the empty string
sed -i "s/\"version\": \"$current_version\"/\"version\": \"$new_version\"/1" $file_path
fi

# Git commit and push
# git add $file_path
# git commit -m "Update version to $new_version"
# git push origin main # Adjust the branch name as necessary

# echo "Version updated to $new_version and changes pushed to GitHub."
Loading