Skip to content

Commit

Permalink
ci: configure Release Please workflow for automated versioning and ch…
Browse files Browse the repository at this point in the history
…angelog generation
  • Loading branch information
liblaf committed May 10, 2024
1 parent 055e9a0 commit c494eae
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
"acked",
"bidi",
"commitizen",
"ehdmg",
"eifinger",
"httpx",
"levelno",
"liblaf",
"oqmr",
"pycache",
"pydantic",
"pypa",
"pypi",
"pyproject",
"pyright",
"taplo",
"tiktoken",
"typer",
"venv"
"useh",
"venv",
"ztrp"
],
"ignorePaths": ["**/*-lock.*", "**/*.lock*", "**/.cspell.json"],
"allowCompoundWords": true
Expand Down
1 change: 1 addition & 0 deletions .github/release-please/.manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ ".": "0.7.0" }
22 changes: 22 additions & 0 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"changelog-sections": [
{ "type": "feat", "section": "✨ Features" },
{ "type": "fix", "section": "🐛 Bug Fixes" },
{ "type": "perf", "section": "🚀 Performance Improvements" },
{ "type": "revert", "section": "🔙 Reverts" },
{ "type": "docs", "section": "📚 Documentation" },
{ "type": "style", "section": "🎨 Styles" },
{ "type": "chore", "section": "🏗 Miscellaneous Chores" },
{ "type": "refactor", "section": "♻️ Code Refactoring" },
{ "type": "test", "section": "🚦 Tests" },
{ "type": "build", "section": "📦 Build System" },
{ "type": "ci", "section": "💻 Continuous Integration" }
],
"packages": {
".": {
"release-type": "python",
"include-component-in-tag": false
}
}
}
73 changes: 66 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,28 @@ on:
push:

jobs:
release-please:
name: Release Please
permissions:
contents: write
pull-requests: write
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
outputs:
created: ${{ steps.release.outputs.releases_created }}
tag: ${{ steps.release.outputs.tag_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: release
name: Release Please
uses: google-github-actions/release-please-action@v4
with:
config-file: .github/release-please/config.json
manifest-file: .github/release-please/.manifest.json

build:
name: Build Package
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -15,14 +35,12 @@ jobs:
- name: Install Dependencies
run: rye sync
- name: Build Package
run: |-
source .venv/bin/activate
make dist
run: rye build
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: pkg
path: dist/*
name: dist
path: dist

pre-release:
name: Pre-release
Expand All @@ -41,12 +59,53 @@ jobs:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
merge-multiple: true
- name: Create GitHub Release
uses: liblaf/repo/.github/actions/release@main
with:
tag: dev
files: dist/*
pre-release: true
recreate: true

publish:
name: Publish
permissions:
id-token: write
needs:
- release-please
- build
if: needs.release-please.outputs.created == 'true'
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

release:
name: Release
permissions:
contents: write
needs:
- release-please
- build
if: needs.release-please.outputs.created == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Create GitHub Release
uses: liblaf/repo/.github/actions/release@main
with:
tag: ${{ needs.release-please.outputs.tag }}
files: dist/*

0 comments on commit c494eae

Please sign in to comment.