mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:29:02 +01:00 
			
		
		
		
	 9ba49bdc5f
			
		
	
	
		9ba49bdc5f
		
	
	
	
	
		
			
			git-subtree-dir: apps/web-clipper git-subtree-mainline: b0e519071893ce9434dd3bb3a568b3e41332c718 git-subtree-split: 786d249a6effe0262859d05e6cb1737e5fc8bdd8
		
			
				
	
	
		
			73 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			73 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| set -e
 | |
| 
 | |
| export GITHUB_REPO=trilium-web-clipper
 | |
| 
 | |
| if [[ $# -eq 0 ]] ; then
 | |
|     echo "Missing argument of new version"
 | |
|     exit 1
 | |
| fi
 | |
| 
 | |
| VERSION=$1
 | |
| 
 | |
| if ! [[ ${VERSION} =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(-.+)?$ ]] ;
 | |
| then
 | |
|     echo "Version ${VERSION} isn't in format X.Y.Z"
 | |
|     exit 1
 | |
| fi
 | |
| 
 | |
| if ! git diff-index --quiet HEAD --; then
 | |
|     echo "There are uncommitted changes"
 | |
|     exit 1
 | |
| fi
 | |
| 
 | |
| echo "Releasing Trilium Web Clipper $VERSION"
 | |
| 
 | |
| jq '.version = "'"$VERSION"'"' manifest.json | sponge manifest.json
 | |
| 
 | |
| git add manifest.json
 | |
| 
 | |
| echo 'module.exports = { buildDate:"'$(date --iso-8601=seconds)'", buildRevision: "'$(git log -1 --format="%H")'" };' > build.js
 | |
| 
 | |
| git add build.js
 | |
| 
 | |
| TAG=v$VERSION
 | |
| 
 | |
| echo "Committing package.json version change"
 | |
| 
 | |
| git commit -m "release $VERSION"
 | |
| git push
 | |
| 
 | |
| echo "Tagging commit with $TAG"
 | |
| 
 | |
| git tag "$TAG"
 | |
| git push origin "$TAG"
 | |
| 
 | |
| bin/release-firefox.sh
 | |
| bin/release-chrome.sh
 | |
| 
 | |
| FIREFOX_BUILD=trilium_web_clipper-$VERSION-an+fx.xpi
 | |
| CHROME_BUILD=trilium_web_clipper-${VERSION}-chrome.zip
 | |
| 
 | |
| echo "Creating release in GitHub"
 | |
| 
 | |
| github-release release \
 | |
|     --tag "$TAG" \
 | |
|     --name "$TAG release"
 | |
| 
 | |
| echo "Uploading firefox build package"
 | |
| 
 | |
| github-release upload \
 | |
|     --tag "$TAG" \
 | |
|     --name "$FIREFOX_BUILD" \
 | |
|     --file "dist/$FIREFOX_BUILD"
 | |
| 
 | |
| echo "Uploading chrome build package"
 | |
| 
 | |
| github-release upload \
 | |
|     --tag "$TAG" \
 | |
|     --name "$CHROME_BUILD" \
 | |
|     --file "dist/$CHROME_BUILD"
 | |
| 
 | |
| echo "Release finished!"
 |