Skip to content
Daniel Mach edited this page Sep 23, 2024 · 11 revisions

New release on GitHub

Clone the sources

git clone [email protected]:openSUSE/osc.git
cd osc

Increase version

  • Increase version in the following places:
    • __version__ in osc/__init__.py
    • Version: in contrib/osc.spec
  • The version format is MAJOR.MINOR.PATCH.
  • Increase PATCH if you're making a patch release.
  • If any features are included, increase MINOR and reset PATCH.

Update NEWS

Generate a list of changes from the previous release:

git log --oneline --no-decorate --no-merges  $(git describe --tags --abbrev=0)..HEAD

Update NEWS file accordingly. Include only changes relevant to the users. For example if there's a commit that did not get to any release and was immediately reverted, there's no need to mention it.

Commit, tag, push

# generate the git commit and git tag commands
python3 -c "import osc; print(f'git commit -m \'release {osc.__version__}\' -a'); print(f'git tag {osc.__version__}')"

git commit -m "release MAJOR.MINOR.PATCH" -a
git tag MAJOR.MINOR.PATCH

# review the commit
git show

git push
git push --tags

Releasing to openSUSE:Tools

Branch the package

Go to https://build.opensuse.org/package/show/openSUSE:Tools/osc and click Branch Package

Checkout the package

osc co <your-branch>/osc
cd $_

Update sources

  • Remove the current tarball: osc rm *.tar.gz
  • Sync spec with the spec from upstream git
  • Change Version in osc.spec (if needed)
  • Generate a new tarball and apply the version change to other files: osc service manualrun
  • Add the new tarball: osc add *.tar.gz
  • Update the changelog by running osc vc and use the relevant part of the NEWS file from git
  • Review output of osc status and osc diff commands
  • Try a local build: osc build
  • Push changes: osc commit

Submit a request to openSUSE:Tools

Run osc sr or osc sr --supersede=<OLD-REQUEST-ID> if superseding an existing request.

If within the next few days no major bugs are reported, the openSUSE:Tools/osc package is submitted to openSUSE:Factory. Moreover, if no major bugs are reported in the next two weeks, a maintenance update is created for all released openSUSE versions.

Creating tarball from a local git repo

  • ❗ You normally don't need to follow this step, it is documented just in case someone needs to generate a tarball without pushing all changes to GitHub first.
  • Commit changes to git repo and tag the commit
  • Run: export PREFIX="osc-$(git describe --tags --abbrev=0)"; git archive --format=tar.gz --prefix="$PREFIX/" --output="$PREFIX.tar.gz" HEAD

Releasing to pypi

If you don't have an API token for uploading osc to pypi created yet, visit https://pypi.org/manage/account/ and create one.

zypper install git python3-twine
git clone https://github.com/openSUSE/osc.git
cd osc
python3 setup.py sdist
read -s -p "Enter your token uploading osc to pypi: " TOKEN
twine upload --username=__token__ --password="$TOKEN" dist/osc-*.tar.gz

Releasing a maintenance release to SLE

  • List all branches: osc -A ibs maintained osc

  • Check if there's a corresponding branch for a supported release: https://www.suse.com/lifecycle#suse-linux-enterprise-server-15

    We're changing the oldest supported release and the package gets inherited to newer releases automatically.

  • If there's a corresponding branch already, we can branch it directly

    Otherwise we need use the --new-package option to branch against the selected project

  • Branch the package:

    osc -A ibs branch [--new-package] SUSE:SLE-15-SP{NUM}:Update/osc
    
  • Checkout the sources (The previous osc branch suggests the command we should use)

  • Modify the sources as needed (typically sync with openSUSE:Factory/osc or openSUSE:Tools/osc)

  • Commit: osc ci

  • Submit the maintenance release: osc mr