Skip to content

Commit

Permalink
Fully automatic release versioning (#197)
Browse files Browse the repository at this point in the history
* Tweak default release-drafter config

* Bump copyright

* Bump release version

* Moving versioning responsibility into GitHub Actions

* Modernizing RELEASING.md
  • Loading branch information
blast-hardcheese authored Dec 9, 2023
1 parent a03fc57 commit e6bd7a9
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name-template: 'v$RESOLVED_VERSION 🌈'
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,31 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade poetry
- name: Set release version
run: |
tag="${GITHUB_REF_NAME}"
version="${tag#v}" # Strip leading v
# Bump poetry tag
poetry version "$version"
# Bump docs tag
sed -i'' 's/^release = "[^"]*"/release = "'"$version"'"/' docs/conf.py
# Bump docs copyright
year="$(date +%Y)"
sed -i'' 's/^copyright = "[^"]*"/copyright = "Replit, '"$year"'"/' docs/conf.py
- name: Build and publish
run: |
poetry build
Expand Down
6 changes: 0 additions & 6 deletions RELEASING

This file was deleted.

8 changes: 8 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Cutting new releases is fully managed by GitHub Actions.
Version numbers do not need to be set in files prior to releasing, as they are incorporated on the fly.

1. Navigate to https://github.com/replit/replit-py/releases
1. Find the latest `Draft` release, click `Edit`
1. Verify that the draft looks like what you'd expect
1. Scroll to the bottom and click `Publish`
1. Navigate to [`Upload Python Package`](https://github.com/replit/replit-py/actions/workflows/python-publish.yml) and watch your release
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
# -- Project information -----------------------------------------------------

project = "replit-py"
copyright = "2021"
copyright = "Replit, 2023"
author = "<a href='https://repl.it/'>Replit</a>"

# The full version, including alpha/beta/rc tags
release = "3.3.0"
release = "0.0.0" # Set via GitHub Actions
html_theme = "alabaster"

# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "replit"
version = "3.5.0"
version = "0.0.0" # Set by GitHub Actions
description = "A library for interacting with features of repl.it"
authors = ["Repl.it <[email protected]>", "mat <[email protected]>", "kennethreitz <[email protected]>", "Scoder12 <[email protected]>", "AllAwesome497", ]
license = "ISC"
Expand Down

0 comments on commit e6bd7a9

Please sign in to comment.