-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update repo with recommended release files
- Loading branch information
Tomas Peterka
committed
Feb 7, 2024
1 parent
cf9f3ff
commit 1d60322
Showing
5 changed files
with
119 additions
and
1 deletion.
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 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.py] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
max_line_length = 100 |
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,43 @@ | ||
name: "[auto] release-python" | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
build: | ||
name: Release new version to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check version format vMAJOR.MINOR.PATCH(-SUFFIX) | ||
run: | | ||
if [[ ! "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*)?$ ]]; then | ||
echo "Invalid version format. Expected vMAJOR.MINOR.PATCH(-SUFFIX)?, got ${GITHUB_REF_NAME}" | ||
exit 1 | ||
fi | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install the project | ||
uses: dronetag/actions/release-python@main | ||
with: | ||
pypi_name: dronetag | ||
pypi_host: ${{ secrets.PRIV_PIP_HOST }} | ||
pypi_user: ${{ secrets.PRIV_PIP_USER }} | ||
pypi_pass: ${{ secrets.PRIV_PIP_PASSWORD }} | ||
version: "${GITHUB_REF_NAME#v}" | ||
|
||
- name: Commit version on release branch | ||
run: | | ||
if [[ $(git rev-parse heads/main) = $(git rev-parse ${GITHUB_REF}) ]]; then | ||
echo "We are at the top of main branch so we can commit the version bump" | ||
git checkout main | ||
git add pyproject.toml | ||
git commit -m "Release ${GITHUB_REF_NAME#v} [skip ci]" | ||
git push | ||
fi |
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,24 @@ | ||
name: "RELEASE" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: Create release tag | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository (full-depth) | ||
uses: actions/checkout@v4 | ||
with: { fetch-depth: 0 } # Required to determine version | ||
|
||
- name: Get next release version | ||
uses: dronetag/actions/get-next-version@main | ||
id: get-next-version | ||
|
||
- name: Create the tag | ||
run: | | ||
ls -al # just for testing the changelog artifact | ||
git config --local user.email "" && git config --local user.name "GitHub Action" | ||
git tag -a "v${{ steps.get-next-version.outputs.version }}" -m "${{ steps.get-next-version.outputs.changelog }}" | ||
git push origin "v${{ steps.get-next-version.outputs.version }}" |
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 @@ | ||
{ | ||
"branches": [ | ||
{ "name": "main" }, | ||
{ "name": "[a-z]+/([a-zA-Z0-9\\-]+)", "prerelease": "${name.replace(/^.*\\//g, '')}"} | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"releaseRules": [ | ||
{ "type": "refactor", "release": "patch"}, | ||
{ "type": "perf", "release": "patch" } | ||
] | ||
} | ||
], | ||
"@semantic-release/release-notes-generator" | ||
] | ||
} |