Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Test release CI with v0.0.1 tag
Browse files Browse the repository at this point in the history
  • Loading branch information
boholder committed Sep 2, 2022
1 parent 1469af4 commit 5dd16cb
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 60 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This workflow will and only will update "dev" version documentation,
# following documentation updates in development.
name: Documentation

on:
Expand Down Expand Up @@ -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
Expand Down
91 changes: 39 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,76 @@
# 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

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

- uses: actions/setup-python@v4
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 "[email protected]"
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/[email protected]
- 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 "[email protected]"
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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
- The tool is working now, but its function is limited by status of only a few rules exist.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" },
Expand Down

0 comments on commit 5dd16cb

Please sign in to comment.