diff --git a/.github/workflows/pre_release.yml b/.github/workflows/pre_release.yml new file mode 100644 index 0000000..1051d45 --- /dev/null +++ b/.github/workflows/pre_release.yml @@ -0,0 +1,82 @@ +# This is a basic workflow to help you get started with Actions + +name: Release a new pre version + +on: + push: + tags: + - 'pre*' + + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + + - name: Extract tag name + id: tag + uses: actions/github-script@0.2.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + return context.payload.ref.replace("refs/tags/pre", ''); + + - name: Export tag + run: | + echo "${{ steps.tag.outputs.result }}" + echo "::set-env name=SETUP_VERSION_OVERWRITE::${{ steps.tag.outputs.result }}" + echo "::set-env name=TWINE_USERNAME::__token__" + echo "::set-env name=TWINE_PASSWORD::${{ secrets.TESTPYPI_TOKEN }}" + + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install deps + run: | + pip install -r test-requirements.txt && + pip install --upgrade setuptools wheel twine + timeout-minutes: 3 + + - name: Build wheel + run: | + python setup.py sdist bdist_wheel + timeout-minutes: 3 + + - + name: Check with Twine + run: | + twine check dist/* + timeout-minutes: 3 + + - + name: Upload with Twine + run: | + twine upload --disable-progress-bar --non-interactive --repository testpypi dist/* + timeout-minutes: 3 + + - uses: actions/upload-artifact@v2 + with: + name: Release Build + path: dist/* + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Pre-release ${{ github.ref }} + draft: true + prerelease: true \ No newline at end of file diff --git a/README.md b/README.md index d3dc2ce..9bdd501 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ ![Unit Test dev and main branch](https://github.com/maxisoft/Freenom-dns-updater/workflows/Unit%20Test%20dev%20and%20main%20branch/badge.svg) ![PyPI - Wheel](https://img.shields.io/pypi/wheel/Freenom-dns-updater) + A tool written in python to update [freenom](http://Freenom.com)'s dns records ## Main Features diff --git a/setup.py b/setup.py index 61b0529..8006fd4 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ # To use a consistent encoding from codecs import open from os import path +import os here = path.abspath(path.dirname(__file__)) @@ -24,10 +25,12 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.1.1', + version=os.environ.get('SETUP_VERSION_OVERWRITE', '1.1.1'), description="A tool to update freenom's dns records", + long_description=long_description, + long_description_content_type="text/markdown", # The project's main homepage. url='https://github.com/maxisoft/Freenom-dns-updater',