forked from camas/setuptools-git-ver
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
337 additions
and
324 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
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 |
---|---|---|
|
@@ -10,10 +10,10 @@ jobs: | |
if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'dependabot[bot]' | ||
|
||
steps: | ||
- uses: alexwilson/[email protected] | ||
with: | ||
github-token: ${{ secrets.PERSONAL_TOKEN }} | ||
merge-method: REBASE | ||
- uses: alexwilson/[email protected] | ||
with: | ||
github-token: ${{ secrets.PERSONAL_TOKEN }} | ||
merge-method: REBASE | ||
|
||
autoapprove: | ||
name: Automatically approve pull request | ||
|
@@ -22,6 +22,6 @@ jobs: | |
if: github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'dependabot[bot]' | ||
|
||
steps: | ||
- uses: hmarr/auto-approve-action@v4 | ||
with: | ||
github-token: ${{ secrets.PERSONAL_TOKEN }} | ||
- uses: hmarr/auto-approve-action@v4 | ||
with: | ||
github-token: ${{ secrets.PERSONAL_TOKEN }} |
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Release | |
on: | ||
push: | ||
tags: | ||
- v* | ||
- v* | ||
|
||
env: | ||
DEFAULT_PYTHON: '3.12' | ||
|
@@ -22,67 +22,67 @@ jobs: | |
contents: write # to create Github release | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} | ||
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release- | ||
${{ runner.os }}-python | ||
${{ runner.os }}- | ||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release-${{ hashFiles('requirements*.txt') }} | ||
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-release- | ||
${{ runner.os }}-python | ||
${{ runner.os }}- | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip setuptools wheel | ||
- name: Upgrade pip | ||
run: python -m pip install --upgrade pip setuptools wheel | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt -r requirements-doc.txt | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt -r requirements-doc.txt | ||
|
||
- name: Inject slug/short variables | ||
uses: rlespinasse/[email protected] | ||
- name: Inject slug/short variables | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Patch setup.py with explicit version number | ||
- name: Patch setup.py with explicit version number | ||
# Fix for https://github.com/dolfinus/setuptools-git-versioning/issues/72#issuecomment-1312589464 | ||
run: | | ||
version=$(echo $GITHUB_REF_SLUG | sed -E "s/v(.*)/\1/") | ||
sed -i -E "/from setuptools_git_versioning.*/d" setup.py | ||
sed -i -E "s/version=.*/version='${version}',/" setup.py | ||
run: | | ||
version=$(echo $GITHUB_REF_SLUG | sed -E "s/v(.*)/\1/") | ||
sed -i -E "/from setuptools_git_versioning.*/d" setup.py | ||
sed -i -E "s/version=.*/version='${version}',/" setup.py | ||
- name: Build package | ||
run: python setup.py sdist bdist_wheel | ||
- name: Build package | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Build release notes | ||
run: | | ||
mkdir reports/ | ||
pip install -e . | ||
version=$(echo $GITHUB_REF_SLUG | sed -E "s/v(.*)/\1/") | ||
# lines 1 and 3 are empty, line 2 contains version number, line 4 contains release date | ||
changelog generate-md -c ./docs/conf.py CHANGELOG.rst -v $version | sed "1,4d" > reports/release.md | ||
sed -i -E 's/:github-user:`(.*)`/@\1/g' reports/release.md | ||
sed -i -E 's/:issue:`(.*)`/#\1/g' reports/release.md | ||
sed -i -E 's/:pr:`(.*)`/#\1/g' reports/release.md | ||
- name: Build release notes | ||
run: | | ||
mkdir reports/ | ||
pip install -e . | ||
version=$(echo $GITHUB_REF_SLUG | sed -E "s/v(.*)/\1/") | ||
# lines 1 and 3 are empty, line 2 contains version number, line 4 contains release date | ||
changelog generate-md -c ./docs/conf.py CHANGELOG.rst -v $version | sed "1,4d" > reports/release.md | ||
sed -i -E 's/:github-user:`(.*)`/@\1/g' reports/release.md | ||
sed -i -E 's/:issue:`(.*)`/#\1/g' reports/release.md | ||
sed -i -E 's/:pr:`(.*)`/#\1/g' reports/release.md | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- name: Create Github release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: false | ||
prerelease: false | ||
body_path: reports/release.md | ||
files: | | ||
dist/* | ||
- name: Create Github release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: false | ||
prerelease: false | ||
body_path: reports/release.md | ||
files: | | ||
dist/* |
Oops, something went wrong.