nico2sh / semtag Goto Github PK
View Code? Open in Web Editor NEWA sematic tag script for Git
License: Apache License 2.0
A sematic tag script for Git
License: Apache License 2.0
Hi,
currently it looks like tag is done based on main branch tag. It would be nice to have a feature to make a tag on current branch, e.g., release branch has it's own version lifecycle, different from main branch version.
Sample:
main branch: version 2.0.0
release branch: version 1.5.0
So tagging on release branch would increase 1.5.0, not 2.0.0 version (as it is now)
There are some cases where a tag already exists, so when the git tag
command tries to tag HEAD
, it fails with the message fatal: tag '' already exists. However, the script doesn't exit 1
so the CI pipeline continues.
% bash semtag final -s patch
fatal: tag 'v0.0.4' already exists
v0.0.4 pushed to origin
This is a very simple fix: just add || exit 1
to the git tag -a $__version -m "$__message"
command on line 516:
Line 516 in f5b2c67
git tag -a $__version -m "$__message" || exit 1
Git's error message is satisfactory so no need for additional logic just for a custom messages.
There is another option: add set -o errexit
to the top of semtag. However, I believe this will require additional changes to the semtag to make it work correctly.
Sometimes, you'd rather not have semtag
automatically perform a git fetch
and would like it to work with the currently cloned repo alone.
Proposal: add a flag to disable the git fetch
in init
.
Do you have any preferences for what the flag should be?
Hello,
It appears that there are quite a few hardcoded references to the master
branch in this tool.
Github has been working on moving the default branch name from master
to main
. It seems like this will begin breaking on more and more people's repositories. Thoughts on making the branch name configurable? Or releasing a new version where it's defaulted to main
instead?
Hi Nico, first thanks for the tool, very useful.
Could you consider adding support for the use case where multiple remotes are defined. I imagine lots of developers will follow a origin / fork strategy. At the moment, the remote check 'git remote' can return a list, which will fail in the following git push.
It would be useful to support pushing to one or more remotes.
Thanks,
Damian.
Is there any way to disable something like this,
I hope something like 0.0.1-alpha.2
, without "v" prefix (v0.0.1-alpha.2
)
semtag alpha -s patch
2021-01-25T03:31:53Z
v0.0.1-alpha.2
Hi,
Would it be possible for you to publish/release an integrity check of some kind? Like either md5, sha256sum, whatever you'd like... You could release it along with your semtag.tar.gz / zip files.
Would be of huge help, I can help you write the code if you'd like, we could put the repo on CircleCI or TravisCI for free?
Thanks again!!
Github is in the process of switching to using main
as the default for a default branch. This breaks with semtag as there are some occurrences of hard-coding master
in the code.
The default branch can be retrieved programmatically using git symbolic-ref refs/remotes/origin/HEAD | sed "s@^refs/remotes/origin/@@"
.
Copied from antonbabenko/pre-commit-terraform#99
It would be nice to mark the latest release accordingly so that other scripts can get latest
using single API call to GitHub API, as described here.
I have a tag that semtag has just moved to v19.1.1-beta.10. This is generated with
source semtag beta
I have since done a few commits, when I run the semtag command it wont move passed 10. Have you previously seen an example > 10?
Thanks,
Damian.
If you use inside release.sh script: set -Eeou pipefail
By the way the release.sh could be changed to work outside the source code and and .gitignore "semtag*" or similar. Improvement would be rewrite to script to change version in all files recursive in an given release folder - but its questionary to change always the source code to add the version number.
What is the Semtag license?
I have to maintain two different versions - v2.*
and v1.*
(for legacy and bug-fixes).
Now I got "Version can't be lower than last version: v2.0.0" if I try to release into v1:
semtag final -v v1.23.0 -f
Any ideas? Or workarounds?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.