Telecommunication-Telemedia-Assessment / bitstream_mode3_p1204_3

Open source reference implementation of ITU-T P.1204.3
Other
58 stars 15 forks source link

release script #6

Closed stg7 closed 4 years ago

stg7 commented 4 years ago

I always get

sgoering@avt29 ~/p/bitstream_mode3_p1204_3> ./release.py -n patch                                                     master!?
Current version: 0.1.1
move to next version inside repo: 0.1.2
update pyproject.toml
update p1204_3/__init__.py
committing and pushing to remote
git commit -m 'move to next version: 0.1.2'
git tag v0.1.2
poetry run gitchangelog
Traceback (most recent call last):
  File "./release.py", line 102, in <module>
    main()
  File "./release.py", line 90, in main
    ch.write(changelog.decode("utf-8"))
AttributeError: 'str' object has no attribute 'decode'

@slhck can you confirm this, or did i missed something?

stg7 commented 4 years ago

btw, can we implement the current master version to have, e.g. 0.1.2-dev?, what is your opinion?

can we add that it pushes to all remotes, or is this already handled? (didn't saw it)

slhck commented 4 years ago

I will check it. I needed to decode the output of the call but there might be a bug.

slhck commented 4 years ago

And I will add a push to all remotes. This is not handled at the moment.

slhck commented 4 years ago

I'm not sure how we can achieve that the current version is always -dev. This would mean that we have to:

But having a commit to add -dev seems weird.

stg7 commented 4 years ago

Then we skip the idea of -dev

stg7 commented 4 years ago

curious: with "https://github.com/Telecommunication-Telemedia-Assessment/bitstream_mode3_p1204_3/pull/7" i get:

Current version: 0.1.1
move to next version inside repo: 0.1.2
update pyproject.toml
update p1204_3/__init__.py
committing and pushing to remote
Traceback (most recent call last):
  File "./release.py", line 105, in <module>
    main()
  File "./release.py", line 85, in main
    run_cmd(["git", "commit", "-m", message], cli_args.dry_run)
  File "./release.py", line 16, in run_cmd
    return subprocess.check_output(cmd).decode("utf-8")
  File "/usr/lib/python3.7/subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'commit', '-m', 'move to next version: 0.1.2']' returned non-zero exit status 1.

dry run works now, dont know what is wrong now

slhck commented 4 years ago

That's strange. I will finally fix it tomorrow and make a new patch release on master, then I can better test it.

stg7 commented 4 years ago

perfect

stg7 commented 4 years ago

i have Python 3.7.5, on ubuntu 19.10, maybe it is a python related issue

stg7 commented 4 years ago

the reason was fhe following (or similar):

Command '['git', 'commit', '-m', 'move to next version: 0.1.5']' returned non-zero exit status 1.
To github.com:Telecommunication-Telemedia-Assessment/bitstream_mode3_p1204_3.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:Telecommunication-Telemedia-Assessment/bitstream_mode3_p1204_3.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Command '['git', 'push', 'github']' returned non-zero exit status 1.

i added some error output to the command line

slhck commented 4 years ago

Ah! Maybe we should always pull/rebase before releasing.

stg7 commented 4 years ago

yes, i think this would be a good way

slhck commented 4 years ago

I think I fixed it now, but it's always hard to test without actually running the script.

It will tell you if the local branch is not up to date, and exit.

Please check next time if any error occurs.