Skip to content

Commit

Permalink
Merge pull request #495 from ReproNim/enh/release
Browse files Browse the repository at this point in the history
enh: add release workflow
  • Loading branch information
satra authored Jan 14, 2023
2 parents a46b695 + b01a0f6 commit 534bf02
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to pypi on Github release

on:
release:
types: [published]

jobs:
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install build & twine
run: python -m pip install build twine

- name: Publish to pypi
run: |
python -m build
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Auto-release on PR merge

on:
# ATM, this is the closest trigger to a PR merging
push:
branches:
- master

env:
AUTO_VERSION: v10.37.6

jobs:
auto-release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v3

- name: Prepare repository
# Fetch full git history and tags
run: git fetch --unshallow --tags

- name: Unset header
# checkout@v2 adds a header that makes branch protection report errors
# because the Github action bot is not a collaborator on the repo
run: git config --local --unset http./~https://github.com/.extraheader

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Download auto
run: |
auto_download_url="$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/tags/$AUTO_VERSION | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')"
wget -O- "$auto_download_url" | gunzip > ~/auto
chmod a+x ~/auto
- name: Create release
run: |
~/auto shipit -vv
env:
GH_TOKEN: ${{ secrets.AUTO_USER_TOKEN }}
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Software Development
Topic :: Software Development :: Libraries :: Python Modules

[options]
packages = find:
python_requires = >= 3.7
python_requires = >= 3.8
install_requires =
click
etelemetry >= 0.2.0
Expand Down

0 comments on commit 534bf02

Please sign in to comment.