Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cicd): Automate tagging process #24

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 39 additions & 40 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,50 +74,49 @@ jobs:
run: |
pre-commit run --config .pre-commit-test.yaml --all-files --verbose --show-diff-on-failure

# tag_version:
# needs: [pre-commit, tests, pre-commit-hook]
# if: github.ref == 'refs/heads/main' && github.repository == 'butler54/mdformat-frontmatter'
tag_github_publish:
needs: [pre-commit, tests, pre-commit-hook]
if: github.ref == 'refs/heads/main' && github.repository == 'butler54/mdformat-frontmatter'
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
# needs to be a GH admins
token: ${{ secrets.ADMIN_WRITE_PAT }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install python release tools
run: pip install python-semantic-release flit

- name: Release a new version to github
env:
GH_TOKEN: ${{ secrets.ADMIN_WRITE_PAT }}
run: |
git config --global user.name "semantic-release (via Github actions)"
git config --global user.email "semantic-release@github-actions"
semantic-release publish --verbosity=DEBUG
# publish:
# name: Publish to PyPi
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout source
# uses: actions/checkout@v3
# with:
# submodules: true
# fetch-depth: 0
# # needs to be a GH admins
# token: ${{ secrets.ADMIN_WRITE_PAT }}
# - name: Set up Python
# uses: actions/setup-python@v4
# - name: Set up Python 3.9
# uses: actions/setup-python@v1
# with:
# python-version: 3.9
# - name: Install python release tools
# run: pip install python-semantic-release flit

# - name: Release a new version to pypi
# env:
# PYPI_TOKEN: ${{ secrets.PYPI_KEY }}
# GH_TOKEN: ${{ secrets.ADMIN_WRITE_PAT }}
# - name: install flit
# run: |
# pip install flit~=3.0
# - name: Build and publish
# run: |
# git config --global user.name "semantic-release (via Github actions)"
# git config --global user.email "semantic-release@github-actions"
# semantic-release publish --verbosity=DEBUG
# # publish:
# # name: Publish to PyPi
# # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
# # runs-on: ubuntu-20.04
# # steps:
# # - name: Checkout source
# # uses: actions/checkout@v3
# # - name: Set up Python 3.9
# # uses: actions/setup-python@v1
# # with:
# # python-version: 3.9
# # - name: install flit
# # run: |
# # pip install flit~=3.0
# # - name: Build and publish
# # run: |
# # flit publish
# # env:
# # FLIT_USERNAME: __token__
# # FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}
# flit publish
# env:
# FLIT_USERNAME: __token__
# FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ profile = "black"
version_variable = [
'mdformat_frontmatter/__init__.py:__version__'
]
build_command = 'flit build'
branch = 'main'
upload_to_pypi = false
version_source = 'commit'
Loading