-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Gepetto/release
Release
- Loading branch information
Showing
8 changed files
with
169 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
|
||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Release on GitHub & PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: pipx install poetry | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: poetry | ||
- run: poetry publish --build -u __token__ -p ${{ secrets.PYPI_TOKEN }} | ||
- run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
- run: gh release create -t "Release ${{ env.TAG}}" -n "$(awk '/## \[${{ env.TAG }}] - /{flag=1;next}/## \[/{flag=0}flag' CHANGELOG.md)" ${{ env.TAG }} dist/* | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Publish a cmeel release | ||
|
||
A github actions handle the build of the release archives, and push them to PyPI and Github Releases. | ||
To trigger it, we just need to: | ||
|
||
1. use poetry to update the version number | ||
2. update the changelog | ||
3. `git commit` | ||
4. `git tag` | ||
5. `git push` | ||
6. `git push --tags` | ||
|
||
|
||
For this, an helper script is provided: | ||
|
||
```bash | ||
./docs/release.sh [patch|minor|major|x.y.z] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash -eux | ||
# ./docs/release.sh [patch|minor|major|x.y.z] | ||
|
||
[[ $(basename "$PWD") == docs ]] && cd .. | ||
|
||
|
||
OLD=$(poetry version -s) | ||
|
||
poetry version "$1" | ||
|
||
NEW=$(poetry version -s) | ||
DATE=$(date +%Y-%m-%d) | ||
|
||
sed -i "/^## \[Unreleased\]/a \\\n## [v$NEW] - $DATE" CHANGELOG.md | ||
sed -i "/^\[Unreleased\]/s/$OLD/$NEW/" CHANGELOG.md | ||
sed -i "/^\[Unreleased\]/a [v$NEW]: https://github.com/cmake-wheel/cmeel/compare/v$OLD...v$NEW" CHANGELOG.md | ||
|
||
git add pyproject.toml CHANGELOG.md | ||
git commit -m "Release v$NEW" | ||
git tag -s "v$NEW" -m "Release v$NEW" | ||
git push | ||
git push --tags |
Oops, something went wrong.