Skip to content

Commit

Permalink
Merge pull request #11773 from owncloud/chore/release-tags-script
Browse files Browse the repository at this point in the history
chore: scripts for updating versions and creating tags
  • Loading branch information
JammingBen authored Oct 15, 2024
2 parents e35270f + b82e7bb commit 659c047
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 9 deletions.
29 changes: 29 additions & 0 deletions dev/scripts/bump_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# This script bumps the version in the package.json files of the main app
# and all published packages to the provided version.
#
# NOTE: only run this if all packages are supposed to get the same version!

apps=("design-system" "eslint-config" "web-pkg" "web-client" "web-test-helpers")

NEW_VERSION="$1"

if [ -z "$NEW_VERSION" ]; then
echo "Error: No new version provided."
echo "Usage: $0 <new_version>"
exit 1
fi

cd "$(dirname "$0")/../.."
CURRENT_VERSION=$(node -p "require('./package.json').version")
sed -i '' "s/\"version\": \"${CURRENT_VERSION}\"/\"version\": \"${NEW_VERSION}\"/" package.json

for app in "${apps[@]}"; do
cd "./packages/$app"
CURRENT_VERSION=$(node -p "require('./package.json').version")
sed -i '' "s/\"version\": \"${CURRENT_VERSION}\"/\"version\": \"${NEW_VERSION}\"/" package.json
cd "../.."
done

echo "package.json files have been updated to version $NEW_VERSION"
26 changes: 26 additions & 0 deletions dev/scripts/create_and_push_tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# This script creates and pushes tags for the main app and all published packages.

APPS=("design-system" "eslint-config" "web-pkg" "web-client" "web-test-helpers")

cd "$(dirname "$0")/../.."
VERSION=$(node -p "require('./package.json').version")
TAG="v${VERSION}"

git tag "$TAG"
git push origin "$TAG"
echo "v$VERSION has been created and pushed"

for app in "${APPS[@]}"; do
cd "./packages/$app"

VERSION=$(node -p "require('./package.json').version")
TAG="${app}-v${VERSION}"

git tag "$TAG"
git push origin "$TAG"

echo "$app-v$VERSION has been created and pushed"
cd "../.."
done
18 changes: 9 additions & 9 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Releasing"
title: 'Releasing'
weight: 25
geekdocRepo: https://github.com/owncloud/web
geekdocEditPath: edit/master/docs
Expand All @@ -10,7 +10,7 @@ geekdocFilePath: releasing.md

## Releasing ownCloud Web

OwnCloud Web can be hosted standalone, as part of oCIS or as ownCloud 10 app (Web UI versions < 7.1.0).
OwnCloud Web can be hosted standalone for a dedicated oCIS backend or bundled as part of oCIS.

### Versioning

Expand All @@ -23,15 +23,15 @@ The highest type before a new release determines the version update number, so i
1. Create a branch `release-$version` in <https://github.com/owncloud/web>.
2. Create a folder in `changelog` for the release version and date `mkdir $major.$minor.$patchVersion_YYYY-MM-DD`.
3. Move all changelog items from the `changelog/unreleased/` folder to the `$major.$minor.$patchVersion_YYYY-MM-DD` folder.
4. Only Web UI versions < 7.1.0: Update the version in `packages/web-integration-oc10/appinfo/info.xml`
5. Update the version in `package.json`
6. Commit your changes.
4. Run `./dev/scripts/bump_versions.sh $version`. This script will bump the `package.json` files in all relevant packages.
5. Commit and push your changes.
6. Run `./dev/scripts/create_and_push_tags.sh`. This script will create and push tags for the main app as well as all packages that need to be released.
7. After merging, wait for the CI to run on the merge commit.
8. Go to the [Releases section](https://github.com/owncloud/web/releases) and click "Draft a new Release".
9. Use `v$major.$minor.$patch` as a tag (the `v` prefix is important) and publish it.
10. The tag and the Release artifacts will be created automatically.
9. The release artifacts will be created automatically.

### Next steps

- The ownCloud 10 app gets created as part of the release pipeline and will be part of the [release assets](https://github.com/owncloud/web/releases).
- For oCIS the release assets need to be updated. For that we have prepared a [separate ocis-web release guide](https://owncloud.dev/extensions/web/releasing/).
For oCIS the release assets need to be updated.

<!-- TODO: add reference to docs on how to update Web in oCIS -->

0 comments on commit 659c047

Please sign in to comment.