Skip to content

Commit

Permalink
Add github actions to test & release the package, add changelog
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 690556345
  • Loading branch information
Conchylicultor authored and The gemma Authors committed Oct 28, 2024
1 parent cd8d814 commit 2a58cfd
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/pytest_and_autopublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Unittests & Auto-publish

# Allow to trigger the workflow manually (e.g. when deps changes)
on: [push, workflow_dispatch]

jobs:
pytest-job:
if: false # TODO(epot): Restore once external tests are fixed
runs-on: ubuntu-latest
timeout-minutes: 30

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4

# Install deps
- uses: actions/setup-python@v5
with:
python-version: "3.10"
# Uncomment to cache of pip dependencies (if tests too slow)
# cache: pip
# cache-dependency-path: '**/pyproject.toml'

- run: pip --version
- run: pip install -e .[dev]
- run: pip freeze

# Run tests (in parallel)
- name: Run core tests
run: pytest -vv -n auto

# Auto-publish when version is increased
publish-job:
if: false # TODO(epot): Restore once publishing is ready
# Only try to publish if:
# * Repo is self (prevents running from forks)
# * Branch is `main`
# if: |
# github.repository == 'google-deepmind/gemma'
# && github.ref == 'refs/heads/main'
needs: pytest-job # Only publish after tests are successful
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 30

steps:
# Publish the package (if local `__version__` > pip version)
- uses: etils-actions/pypi-auto-publish@v1
with:
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
parse-changelog: true
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changelog

<!--
Changelog follow the https://keepachangelog.com/ standard (at least the headers)
This allow to:
* auto-parsing release notes during the automated releases from github-action:
https://github.com/marketplace/actions/pypi-github-auto-release
* Have clickable headers in the rendered markdown
To release a new version (e.g. from `1.0.0` -> `2.0.0`):
* Create a new `# [2.0.0] - YYYY-MM-DD` header and add the current
`[Unreleased]` notes.
* At the end of the file:
* Define the new link url:
`[2.0.0]: https://github.com/google-deepmind/gemma/compare/v1.0.0...v2.0.0`
* Update the `[Unreleased]` url: `v1.0.0...HEAD` -> `v2.0.0...HEAD`
-->

## [Unreleased]

## [1.0.0] - 2022-01-01

* Initial release

[Unreleased]: https://github.com/google-deepmind/gemma/compare/v0.1.0...HEAD
[1.0.0]: https://github.com/google-deepmind/gemma/releases/tag/v0.1.0
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Gemma

<!--
TODO(epot): Restore
[![Unittests](https://github.com/google-deepmind/gemma/actions/workflows/pytest_and_autopublish.yml/badge.svg)](https://github.com/google-deepmind/gemma/actions/workflows/pytest_and_autopublish.yml)
[![PyPI version](https://badge.fury.io/py/gemma.svg)](https://badge.fury.io/py/gemma)
-->

[Gemma](https://ai.google.dev/gemma) is a family of open-weights Large Language
Model (LLM) by [Google DeepMind](https://deepmind.google/), based on Gemini
research and technology.
Expand Down

0 comments on commit 2a58cfd

Please sign in to comment.