WIP: feat: use bumpp to increase version #2929
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#2929
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen/frontend:feature/use-bumpp-for-version"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Related backend PR: vikunja/api#1472
@ -108,3 +108,3 @@
from_secret: cypress_project_key
commands:
- sed -i 's/localhost/api/g' dist/index.html
- sed -i '' 's|localhost|api|g' dist/index.html
I use
|
as delimiter now consequently for sed since we replace a lot of urls, where|
reduces the need to escape. The leading''
is not necessary here but makes it possible to copy these commands and run them on mac.@ -148,3 +148,3 @@
- cp -r dist dist-preview
# Override the default api url used for preview
- sed -i 's|http://localhost:3456|https://try.vikunja.io|g' dist-preview/index.html
- sed -i '' 's|http\://localhost\:3456|https\://try\.vikunja\.io|g' dist-preview/index.html
I read thatWrong!.
and:
on the other hand need to be escaped. Probably I removed the escaping here at some other time.@ -22,1 +22,3 @@
"fonts:subset": "./scripts/fonts-subset.sh"
"fonts:subset": "./scripts/fonts-subset.sh",
"// TODO:": "add release including creating changelog via `git-cliff`",
"bump-version": "pnpm dlx bumpp --no-push \"$(bash ./scripts/update-package-version.sh)\""
We should also include the git-cliff changelog creation script.
That's pretty much
git cliff <last version tag>..HEAD
(not sure how we could always get the last tag). The output then needs to manually copied into thechangelog.md
file and in the tag message.This seems to work:
Shouldn't we better use a template?
@konrad
You mean in git-cliff? Not 100% sure how we would do that. iirc git-cliff can generate a full changelog (not just the changes since the last release) but that does not work when the old commits do not use semantic commits.
@ -12,3 +12,4 @@
# I think this is not necessary since I changed the delimiters to '|'
# Escape the variable to prevent sed from complaining
VIKUNJA_API_URL=$(echo $VIKUNJA_API_URL |sed 's/\//\\\//g')
Do you think we still need this?
Probably not, can we test this?
Removed.
@ -0,0 +25,4 @@
git describe --tags --always --abbrev=10 | sed 's/^v//' | sed 's/-g/-/'
}
# # Update the version field in package.json
I kept the following part in case we don't want to use bumpp
@ -37,2 +38,4 @@
export default defineConfig({
// https://vitest.dev/config/
define: {
'__APP_VERSION__': version,
By using
define
for the__APP_VERSION__
it gets replaced in the whole app.@ -22,4 +22,2 @@
# Build the frontend
pnpm install && \
apk add --no-cache git && \
echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > src/version.json && \
I removed the part where
sed 's/-/+/'
happens.Was there a specific reason why we replace the
-
with a+
?I needed to remove it because else the resulting string wouldn't be compatible with semver.
The string contains the git commit for unstable builds plus the number of commits. I felt like this was a nicer option but it's eye-candy only so fine to remove.
I keep the string. I only changed the part where
-
was changed to+
That's fine. Again, was only eyes-candy before.
ba607b2afc
to5418bfcfd6
5418bfcfd6
tof7d8ffdf0e
@ -207,3 +206,3 @@
- pnpm install --fetch-timeout 100000 --frozen-lockfile
- pnpm run lint
- "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json"
- source ./scripts/update-package-version.sh
Why not just call the script? (Without the
source
)@ -0,0 +1,31 @@
#!/bin/bash
# ensure packages are installed
if [ "$(uname)" == "Darwin" ]; then
I think we should rather check if the tools are installed and if not exit 1 the script and prompt the user to install them. There are too many OS variants which we cannot cover. Also I think it's a bit unexpected for a version update script to install stuff.
We should also add these to the nix flake definition.
that would then also apply to fonttools? I have no experience with nix so I didn't know if or where I should add this.
The flake definition is here: https://kolaente.dev/vikunja/frontend/src/branch/main/flake.nix#L8
The
jq
package is called simplyjq
and thus it should be enough to add an entrypkgs.jq
next to the other packages.Ideally this would apply to fronttools as well, yes.
What about git, docker, wget, b2sum, awk, python (for fonttools) and brotli (for woff2 compression).
Probably a good idea to add those as well. Hit is implicit as it is required for flakes to work.
I don't have enough knowledge of nixos to modify the flake. I tried to install the manager but it failed and I had to revert (it's really complex on mac: if I got it right they create an extra partition). Can you help me here?
Not sure how this works on mac but as per their docs it's correct the installer tries to create an extra partition 🤔
I can add the extra dependencies to the flake if that makes it easier.
Flake file seems to work now.
Did you try with the installer here? https://nixos.org/download.html#nix-install-macos
Yes, that's how I tried.
@konrad And these are already included?
Now they are all added.
Unsure: are the python bindings for brotli included? See: https://fonttools.readthedocs.io/en/latest/optional.html#fonttools-ttlib-woff2
Looks like it: https://github.com/NixOS/nixpkgs/blob/nixos-22.11/pkgs/development/python-modules/fonttools/default.nix#L44
Nice, I guess this is solved then :)
@ -0,0 +9,4 @@
# Alpine
apk add --no-cache git jq
else
apk-get install git jq
This should be
apt-get
(Assuming you meant to install on debian-like systems)Ups. I know, was only confused because of alpines
apk
.@ -0,0 +26,4 @@
# # Update the version field in package.json
# new_version=$(get_new_version_string)
# jq '.version = "'$new_version'"' package.json > package.json.tmp
Why is this commented?
Separated this part in two scripts now, because I needed them in the in the package.json and in the drone config.
Can we document the required steps to publish a new release?
f7d8ffdf0e
tobb6ac732da
I can update https://vikunja.io/docs/releasing-a-new-vikunja-version/
Is that what you mean?
yes.
bb6ac732da
to73edb57fe8
73edb57fe8
to2cad2c8f7d
@ -0,0 +1,26 @@
#!/bin/bash
This should be
/usr/bin/env bash
or/bin/sh
(not sure if we're using any bash specific things here)Shouldn' we then not also update
scripts/run.sh
?Won't hurt. The main difference is the run script only gets executed in the docker container whereas this is meant to run on dev computers.
Will update in order to align.
@ -0,0 +1,5 @@
get_version_string() {
Doesn't this script miss a shebang comment at the top?
@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue'
import legacyFn from '@vitejs/plugin-legacy'
import { URL, fileURLToPath } from 'node:url'
import { dirname, resolve } from 'node:path'
import {version} from './package.json'
Didn't know you could do that, very nice!
I think it’s a vite feature. but did already work with webpack.
2cad2c8f7d
to9d7ffc30bd
@konrad sadly this broke now.
I'm not sure how to untangle this without breaking some of the new docker code TBH.
@dpschen mhh yeah I see what you mean
Is the main problem with untangling it in the Dockerfile and
run.sh
?I didn't check the drone config, but those two seem to be the ones that have the biggest complexity.
Closing this as it appears stale.
Please rebase and reopen if you think this is still relevant.