-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Versioning with poetry and automatic release (#16)
- Loading branch information
1 parent
c36d4d6
commit dac33d8
Showing
6 changed files
with
3,230 additions
and
20 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,49 @@ | ||
name: Release a new version of the plugin | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
create-release: | ||
name: Create Github release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python - -y | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Bump Version | ||
id: bump-version | ||
run: | | ||
# Bump minor version with poetry | ||
poetry version minor | ||
VERSION=$(poetry version --short) | ||
echo VERSION=${VERSION} >> $GITHUB_ENV | ||
# Tag the commit with the new version | ||
git tag $VERSION | ||
git push origin $VERSION | ||
# Push version update in pyproject.toml | ||
git config --global user.name 'IS DevOps Bot' | ||
git config --global user.email '[email protected]' | ||
git add pyproject.toml | ||
git commit -m "action: bump version to ${VERSION}" | ||
git push | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: false | ||
tag: ${{ env.VERSION }} | ||
generateReleaseNotes: true |
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,39 @@ | ||
header: | ||
license: | ||
spdx-id: Apache-2.0 | ||
copyright-owner: Canonical Ltd. | ||
content: | | ||
Copyright [year] [owner] | ||
See LICENSE file for licensing details. | ||
paths: | ||
- '**' | ||
paths-ignore: | ||
- '.github/**' | ||
- '**/.gitkeep' | ||
- '**/*.cfg' | ||
- '**/*.conf' | ||
- '**/*.j2' | ||
- '**/*.json' | ||
- '**/*.md' | ||
- '**/*.rule' | ||
- '**/*.tmpl' | ||
- '**/*.txt' | ||
- '**/*.xml' | ||
- '.codespellignore' | ||
- '.dockerignore' | ||
- '.flake8' | ||
- '.jujuignore' | ||
- '.gitignore' | ||
- '.licenserc.yaml' | ||
- '.trivyignore' | ||
- '.woke.yaml' | ||
- '.woke.yml' | ||
- 'CODEOWNERS' | ||
- 'icon.svg' | ||
- 'LICENSE' | ||
- 'trivy.yaml' | ||
- 'zap_rules.tsv' | ||
- 'lib/**' | ||
- 'poetry.lock' | ||
- 'pytest.ini' | ||
comment: on-failure |
Oops, something went wrong.