diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 25fbe12..7e492da 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -1,3 +1,5 @@ +# This workflow will and only will update "dev" version documentation, +# following documentation updates in development. name: Documentation on: @@ -25,7 +27,7 @@ jobs: - name: Install doc dependencies run: | - pip install pdm + python3 -m pip install -U pdm pdm install -dG doc - name: Build doc and upload to gh-pages branch diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a08a8e7..764277b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,11 @@ -# Action that be active only when a "v*.*.*" version tag is pushed to the repo. +# Workflow that be active only a "v*.*.*" version tag is pushed to the main branch. # Version tags should only be created on commits that HAVE passed unit tests ("TEST" GitHub action). # -# This action will: -# 1. Build wheels and source distribution. -# 2. Upload files generated in step 1 to pypi. +# This workflow will: +# 1. Build wheel and source distribution. +# 2. Upload wheel and source to the pypi. # 3. Create a release with information from CHANGELOG.md. -# -# Drawing on: -# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml -# https://github.com/pdm-project/pdm/blob/main/.github/workflows/release.yml -# https://github.com/softprops/action-gh-release +# 4. Build fixed version documentation and push it to "gh-pages" branch. name: Release @@ -17,21 +13,13 @@ on: push: tags: - "v*.*.*" - pull_request: - tags: - - "v*.*.*" env: default-python: "3.10" jobs: - build: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ windows-latest, macos-latest, ubuntu-latest ] - + build-doc: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -39,52 +27,50 @@ jobs: with: python-version: ${{ env.default-python }} - - name: Install build tool + - name: Install doc dependencies + run: | + python3 -m pip install -U pdm + pdm install -dG doc + + - name: Build doc and upload to gh-pages branch run: | - pip install -U build . + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git fetch origin gh-pages:gh-pages + tag="${{ github.ref_name }}" + DOC_VERSION=${tag%.*} + cd docs && pdm run mike deploy --no-redirect --update-aliases "$DOC_VERSION" latest + git push origin gh-pages + + build-wheel-and-src: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 - - name: Build wheels - uses: pypa/cibuildwheel@v2.9.0 + - uses: actions/setup-python@v4 with: - package-dir: . - output-dir: dist - config-file: "{package}/pyproject.toml" + python-version: ${{ env.default-python }} + + - name: Build wheels and source distribution + run: | + python3 -m pip install -U build + python3 -m build --sdist --wheel . - name: Test wheel build run: | python3 -m venv fresh_env . fresh_env/bin/activate - pip install ./dist/*.whl + python3 -m pip install -U dist/*.whl fresh_env/bin/puntgun --help - - name: Build source distribution - run: | - python -m build --sdist . - - uses: actions/upload-artifact@v3 with: name: artifact path: dist/* - build-doc: - needs: [ build ] - runs-on: ubuntu-latest - steps: - - name: Build documentation - run: | - pip install pdm - pdm install -G doc - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git fetch origin gh-pages:gh-pages - tag="${{ github.ref_name }}" - DOC_VERSION=${tag%.*} - cd docs - pdm run mike deploy --no-redirect --update-aliases "$DOC_VERSION" latest - git push origin gh-pages - upload_to_pypi: - needs: [ build ] + needs: [ build-wheel-and-src ] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v3 @@ -98,18 +84,19 @@ jobs: password: ${{ secrets.PYPI_TOKEN }} create-github-release: - needs: [ build ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Get Changelog + - name: Get changelog run: | awk '/-{3,}/{flag=1;next}/Release/{if (flag==1)exit}flag' CHANGELOG.md > .changelog.md - - name: Create Release + - name: Create release + # https://github.com/softprops/action-gh-release uses: softprops/action-gh-release@v1 with: + name: ${{ github.ref_name }} tag_name: ${{ github.ref }} body_path: .changelog.md draft: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e24979e..1419fca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -# Action to run unit tests and update coverage info to https://coveralls.io +# Workflow to run unit tests and update coverage info to https://coveralls.io # Drawing on: # https://github.com/pypa/pipx/blob/main/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: - name: Install lint dependencies run: | - python -m pip install pdm + python3 -m pip install -U pdm pdm install -dG lint - name: Run lint check @@ -44,7 +44,7 @@ jobs: - name: Install test dependencies run: | - python -m pip install pdm + python3 -m pip install -U pdm pdm install -G test - name: Run pytest @@ -63,7 +63,7 @@ jobs: - name: Install test dependencies run: | - python -m pip install pdm + python3 -m pip install -U pdm pdm install -G test - name: Run coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d206cd..0e105e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ -Release v0.1.0 (2022-09-01) +Release v0.0.1 (2022-09-02) --------------------------- +Publish this version for testing release CI. + ### Features -- A command line tool for automatically processing actions such as blocking on Twitter account. \ No newline at end of file +- The tool is working now, but its function is limited by status of only a few rules exist. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 99b7b03..5f0dac8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ # PEP 621 project metadata # See https://www.python.org/dev/peps/pep-0621/ name = "puntgun" -version = "0.1.0" +version = "0.0.1" description = "A configurable automation command line tool for Twitter." authors = [ { name = "boholder", email = "bottleholder@anche.no" },