You're not a dev ? just submit an issue (bug, improvements, questions).
- you could also fork, feature branch, then submit a pull request.
- Install Node.js and pnpm
- Clone
- Install deps
- setup your test environment (cf. initenv.template.sh)
git clone https://github.com/boly38/action-umami-report.git
cd action-umami-report
pnpm install
# setup test env
cp ./env/initenv.template.sh ./env/initenv.dontpush.sh
# edit ./env/initenv.dontpush.sh then source it
. ./env/initenv.dontpush.sh- To run manual test
. ./env/initenv.dontpush.sh
pnpm day
pnpm showResults
# check other targets in package.json
pnpm run- To run mocha test
. ./env/initenv.dontpush.sh
# run all tests
pnpm test
# run all tests with code coverage
pnpm ci-test
# run a single test file
tst=1_sinon_cloud_umami pnpm tst- To run GitHub action workflow locally, cf TESTING_ACTION
- For GitHub workflows configuration and required secrets, cf workflows/README
Packaging is defined in .github/scripts/package.sh
pnpm install -g @vercel/ncc
ncc build index.js
# package result under dist/This project uses orphan branches to distribute packaged versions of the action (with all dependencies bundled in dist/).
Orphan branches are named after the Umami server version they support (e.g., umami-server-3.0.3).
- Defined in
package.json::orphanBranch - Used for stable releases and QA testing
- Examples:
umami-server-3.0.3for Umami v3.0.3,umami-server-2.17.0for Umami v2.17.x
To trigger packaging, use the to-package branch as a pointer:
# To package the current main branch → creates/updates orphan branch from package.json::orphanBranch
git checkout main
git branch -f to-package
git push origin to-package --force
# To package a specific version tag
git checkout v7.0.0
git branch -f to-package
git push origin to-package --forcepackage.json::orphanBranch of the commit pointed by to-package, not from the current main branch.
What happens when you push to-package:
- Workflow
.github/workflows/main_ci_and_package_action.ymlis triggered withMUST_BE_PACKAGED=true - The workflow checks out the commit pointed by
to-package - The workflow reads the target orphan branch name from that commit's
package.json::orphanBranch - The code is packaged using
@vercel/ncc→ all deps bundled indist/ - A tag
last-<ORPHAN_BRANCH>is created/updated to mark the source commit - The
dist/content is force-pushed to the orphan branch<ORPHAN_BRANCH>
Step-by-step process:
-
Update
package.json::orphanBranchto match the target Umami server version"orphanBranch": "umami-server-3.0.3"
⚠️ This value determines the orphan branch name that will be created!Examples:
"umami-server-3.0.3"for Umami v3.0.3 compatibility (current v7.x)"umami-server-2.17.0"for Umami v2.17.x compatibility (legacy v6.x)
-
Create a version using patch/minor/major:
pnpm version patch # or minor/major git push --follow-tags -
Point
to-packageto the version you want to publish:git checkout v7.0.0 # The commit containing the orphanBranch value git branch -f to-package git push origin to-package --force💡 The workflow will read
package.json::orphanBranchfrom this commit (v7.0.0) -
Verify the workflow execution in GitHub Actions
- Check that
main_ci_and_package_action.ymlcompletes successfully - Verify the orphan branch was updated:
git fetch && git log origin/umami-server-3.0.3 - Verify the tag was created:
git fetch --tags && git show last-umami-server-3.0.3
- Check that
Example scenario:
Suppose you have:
mainbranch withpackage.json::orphanBranch = "umami-server-3.0.3"- Tag
v6.0.2withpackage.json::orphanBranch = "umami-server-2.17.0"
If you run:
git checkout v6.0.2
git branch -f to-package
git push origin to-package --forceThe workflow will:
- Checkout the
v6.0.2commit - Read
package.json::orphanBranchfrom that commit →"umami-server-2.17.0" - Package and push to orphan branch
umami-server-2.17.0(NOTumami-server-3.0.3from main!) - Create tag
last-umami-server-2.17.0pointing tov6.0.2
- install GitHub client
- create automatically a draft release version using gh client
Example to create v6.0.1
gh release create v6.0.1 --draft --generate-notesthis will make a new draft release. Verify it in releases list
⚠️ the repository apply immutable releases since #8, so you can't modify a release once published- publish the release when ready