Skip to content

Commit

Permalink
Merge pull request #98 from dwhswenson/release-0.3.1
Browse files Browse the repository at this point in the history
Release 0.3.1
  • Loading branch information
dwhswenson authored Jul 6, 2021
2 parents 0be82e9 + a59aec9 commit 051a6b9
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 44 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/autorelease-default-env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
INSTALL_AUTORELEASE="python -m pip install autorelease==0.3.0"
# Vendored from Autorelease 0.3.1
# Update by updating Autorelease and running `autorelease vendor actions`
INSTALL_AUTORELEASE="python -m pip install autorelease==0.3.1"
if [ -f autorelease-env.sh ]; then
source autorelease-env.sh
fi
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/autorelease-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Autorelease
# Vendored from Autorelease 0.3.1
# Update by updating Autorelease and running `autorelease vendor actions`
name: "Autorelease Deploy"
on:
release:
types: [published]
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/autorelease-gh-rel.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Autorelease
# Vendored from Autorelease 0.3.1
# Update by updating Autorelease and running `autorelease vendor actions`
name: "Autorelease Release"
on:
push:
branches:
# TODO: this should come from yaml conf
- stable

jobs:
Expand Down Expand Up @@ -31,3 +34,4 @@ jobs:
autorelease-release --project $PROJECT --version $VERSION --token $AUTORELEASE_TOKEN
env:
AUTORELEASE_TOKEN: ${{ secrets.AUTORELEASE_TOKEN }}
name: "Cut release"
7 changes: 4 additions & 3 deletions .github/workflows/autorelease-prep.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# File vencdored from Autorelease; specific version information should be in
# the INSTALL_AUTORELEASE variable in autorelease-default-env.sh
name: "Autorelease"
# Vendored from Autorelease 0.3.1
# Update by updating Autorelease and running `autorelease vendor actions`
name: "Autorelease testpypi"
on:
pull_request:
branches:
# TODO: this should come from yaml conf
- stable

defaults:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: "Unit tests"
on:
pull_request:
branches:
- master
- main
- stable
push:
branches:
- master
- main
tags:
- "v*"
schedule:
Expand Down
10 changes: 5 additions & 5 deletions autorelease-travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AUTORELEASE v0.3.0
# AUTORELEASE v0.3.1
# for nonrelease, use @master
# for release, use v${VERSION}, e.g., v1.0.0
stages:
Expand All @@ -9,7 +9,7 @@ stages:
- deploy pypi

import:
- dwhswenson/autorelease:travis_stages/[email protected].0
- dwhswenson/autorelease:travis_stages/[email protected].0
- dwhswenson/autorelease:travis_stages/[email protected].0
- dwhswenson/autorelease:travis_stages/[email protected].0
- dwhswenson/autorelease:travis_stages/[email protected].1
- dwhswenson/autorelease:travis_stages/[email protected].1
- dwhswenson/autorelease:travis_stages/[email protected].1
- dwhswenson/autorelease:travis_stages/[email protected].1
4 changes: 3 additions & 1 deletion autorelease/gh_actions_stages/autorelease-default-env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
INSTALL_AUTORELEASE="python -m pip install autorelease==0.3.0"
# Vendored from Autorelease $VERSION
# Update by updating Autorelease and running `autorelease vendor actions`
INSTALL_AUTORELEASE="python -m pip install autorelease==$VERSION"
if [ -f autorelease-env.sh ]; then
source autorelease-env.sh
fi
Expand Down
10 changes: 6 additions & 4 deletions autorelease/gh_actions_stages/autorelease-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Autorelease
# Vendored from Autorelease $VERSION
# Update by updating Autorelease and running `autorelease vendor actions`
name: "Autorelease Deploy"
on:
release:
types: [published]
Expand All @@ -15,12 +17,12 @@ jobs:
- run: | # TODO: move this to an action
source ./.github/workflows/autorelease-default-env.sh
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
cat autorelease-env.sh >> $$GITHUB_ENV
fi
if [ -f "./.autorelease/install-autorelease" ]; then
source ./.autorelease/install-autorelease
else
eval $INSTALL_AUTORELEASE
eval $$INSTALL_AUTORELEASE
fi
name: "Install autorelease"
- run: |
Expand All @@ -32,6 +34,6 @@ jobs:
name: "Build and check package"
- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
password: $${{ secrets.pypi_password }}
name: "Deploy to pypi"

16 changes: 10 additions & 6 deletions autorelease/gh_actions_stages/autorelease-gh-rel.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Autorelease
# Vendored from Autorelease $VERSION
# Update by updating Autorelease and running `autorelease vendor actions`
name: "Autorelease Release"
on:
push:
branches:
# TODO: this should come from yaml conf
- stable

jobs:
Expand All @@ -16,18 +19,19 @@ jobs:
- run: | # TODO: move this to an action
source ./.github/workflows/autorelease-default-env.sh
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
cat autorelease-env.sh >> $$GITHUB_ENV
fi
if [ -f "./.autorelease/install-autorelease" ]; then
source ./.autorelease/install-autorelease
else
eval $INSTALL_AUTORELEASE
eval $$INSTALL_AUTORELEASE
fi
name: "Install autorelease"
- run: |
VERSION=`python setup.py --version`
PROJECT=`python setup.py --name`
echo $PROJECT $VERSION
autorelease-release --project $PROJECT --version $VERSION --token $AUTORELEASE_TOKEN
echo $$PROJECT $$VERSION
autorelease-release --project $$PROJECT --version $$VERSION --token $$AUTORELEASE_TOKEN
env:
AUTORELEASE_TOKEN: ${{ secrets.AUTORELEASE_TOKEN }}
AUTORELEASE_TOKEN: $${{ secrets.AUTORELEASE_TOKEN }}
name: "Cut release"
19 changes: 10 additions & 9 deletions autorelease/gh_actions_stages/autorelease-prep.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# File vencdored from Autorelease; specific version information should be in
# the INSTALL_AUTORELEASE variable in autorelease-default-env.sh
name: "Autorelease"
# Vendored from Autorelease $VERSION
# Update by updating Autorelease and running `autorelease vendor actions`
name: "Autorelease testpypi"
on:
pull_request:
branches:
# TODO: this should come from yaml conf
- stable

defaults:
Expand All @@ -22,12 +23,12 @@ jobs:
- run: | # TODO: move this to an action
source ./.github/workflows/autorelease-default-env.sh
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
cat autorelease-env.sh >> $$GITHUB_ENV
fi
if [ -f "./.autorelease/install-autorelease" ]; then
source ./.autorelease/install-autorelease
else
eval $INSTALL_AUTORELEASE
eval $$INSTALL_AUTORELEASE
fi
name: "Install autorelease"
- run: |
Expand All @@ -43,7 +44,7 @@ jobs:
name: "Build and check package"
- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.testpypi_password }}
password: $${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
name: "Deploy to testpypi"
test_testpypi:
Expand All @@ -58,19 +59,19 @@ jobs:
- run: | # TODO: move this to an action
source ./.github/workflows/autorelease-default-env.sh
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
cat autorelease-env.sh >> $$GITHUB_ENV
fi
if [ -f "./.autorelease/install-autorelease" ]; then
source ./.autorelease/install-autorelease
else
eval $INSTALL_AUTORELEASE
eval $$INSTALL_AUTORELEASE
fi
name: "Install autorelease"
- name: "Install testpypi version"
run: install-testpypi
- name: "Test testpypi version"
run: |
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
cat autorelease-env.sh >> $$GITHUB_ENV
fi
test-testpypi
10 changes: 6 additions & 4 deletions autorelease/release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ def write_pull_line(self, pull, extra_labels=None):
title = pull['title']
number = str(pull['number'])
author = pull['user']['login']
out_str = "* " + title + " (#" + number
url = pull['html_url']
pull_link = "([#" + number + "](" + url + ")"
if author not in self.config['standard_contributors']:
out_str += " @" + author
out_str += ")"
pull_link += " @" + author
pull_link += ")"
out_str = "* " + title + " " + pull_link
for label in extra_labels:
label = label.replace(' ', '_')
out_str += " #" + label
Expand All @@ -139,7 +141,7 @@ def output_for_known_labels(self, pull_dict, pull_to_labels):
out_str = ""
for lbl in self.config['labels']:
label = lbl['label']
out_str += "\n# " + lbl['heading'] + "\n"
out_str += "\n## " + lbl['heading'] + "\n"
for pull in pull_dict[label]:
pull_labels = set(pull_to_labels[pull['number']])
extra_labels = pull_labels - set([label])
Expand Down
15 changes: 10 additions & 5 deletions autorelease/scripts/vendor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pkg_resources
import string
import pathlib
import shutil

import click
import pkg_resources
from packaging.version import Version
import autorelease

def vendor(resources, base_path, relative_target_dir):
for resource in resources:
Expand All @@ -12,7 +12,12 @@ def vendor(resources, base_path, relative_target_dir):
target_dir.mkdir(parents=True, exist_ok=True)
target_loc = base_path / relative_target_dir / name
# print(f"cp {orig_loc} {target_loc}")
shutil.copy(orig_loc, target_loc)
with open(orig_loc, mode='r') as rfile:
template = string.Template(rfile.read())

version = Version(autorelease.version.version).base_version
with open(target_loc, mode='w') as wfile:
wfile.write(template.substitute(VERSION=version))

def vendor_actions(base_path):
resources = ['autorelease-default-env.sh', 'autorelease-prep.yml',
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: autorelease
# add ".dev0" for unreleased versions
version: "0.3.0"
version: "0.3.1"

source:
path: ../../
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = autorelease
version = 0.3.0
version = 0.3.1
# version should end in .dev0 if this isn't to be released
short_description = Tools to keep the release process clean.
description = Tools to keep the release process clean.
Expand Down

0 comments on commit 051a6b9

Please sign in to comment.