Skip to content

Commit

Permalink
Merge pull request #21 from m4rc1e/build
Browse files Browse the repository at this point in the history
CI: add publish_release
  • Loading branch information
m4rc1e authored Jan 24, 2023
2 parents 12387e5 + 7142b0f commit b6fc195
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
push:
tags:
- "v*" # Push events to matching `v*` version srings. e.g. v1.0, v20.15.10

name: Create and Publish Release

jobs:
build:
name: Create and Publish Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install release dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine build poetry
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Get release notes
id: release_notes
run: |
# By default, GH Actions checkout will only fetch a single commit.
# For us to extract the release notes, we need to fetch the tags
# and tag annotations as well.
# https://github.com/actions/checkout/issues/290
git fetch --tags --force
TAG_NAME=${GITHUB_REF/refs\/tags\//}
echo "$(git tag -l --format='%(contents)' $TAG_NAME)" > "${{ runner.temp }}/CHANGELOG.md"
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: "${{ runner.temp }}/CHANGELOG.md"
draft: false
prerelease: false

- name: Build and publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload -r testpypi dist/*
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[tool.poetry]
name = "diffenator2"
description = "Compare two fonts"
version = "0.0.1"
authors = [ "Marc Foley <m.foley.88@gmail.com>" ]
version = "0"

[tool.poetry-dynamic-versioning]
enable = true
source = "git-tag"

[tool.poetry.dependencies]
python = ">=3.7,<4.0"
Expand All @@ -22,8 +26,8 @@ tqdm = "^4.64.1"
youseedee = "^0.3.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry.scripts]
_diffbrowsers = 'diffenator2._diffbrowsers:main'
Expand Down

0 comments on commit b6fc195

Please sign in to comment.