-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Migrate to commitizen to bump version
- Loading branch information
1 parent
b270cac
commit 7930ffd
Showing
4 changed files
with
50 additions
and
50 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,33 @@ | ||
name: Bump Version | ||
|
||
on: | ||
push: | ||
# Trigger unless only the wiki directory changed | ||
paths-ignore: | ||
- "wiki/**" | ||
- "**/**.md" | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
bump: | ||
if: "!startsWith(github.event.head_commit.message, 'bump:')" | ||
runs-on: ubuntu-latest | ||
environment: bump | ||
concurrency: bump | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Bump version | ||
id: cz | ||
uses: commitizen-tools/commitizen-action@master | ||
with: | ||
github_token: ${{ secrets.PERSONAL_ACCESS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,18 @@ name: Publish Release | |
|
||
on: | ||
push: | ||
# Trigger only when uk_bin_collection/uk_bin_collection directory changes | ||
paths: | ||
- "uk_bin_collection/uk_bin_collection/**" | ||
branches: [ "master" ] | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
concurrency: release | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
@@ -36,36 +31,17 @@ jobs: | |
- name: Install | ||
run: make install | ||
|
||
- name: Python Semantic Release | ||
id: release | ||
uses: python-semantic-release/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} # May need to replace with a Personal Access Token if it fails | ||
- name: Set release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- uses: ncipollo/release-action@v1 | ||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.release.outputs.tag }} | ||
allowUpdates: true | ||
tag: ${{ env.RELEASE_VERSION }} | ||
generateReleaseNotes: true | ||
|
||
- name: Update manifest.json version | ||
if: steps.release.outputs.released == 'true' | ||
uses: jossef/[email protected] | ||
with: | ||
file: custom_components/uk_bin_collection/manifest.json | ||
field: version | ||
value: ${{ steps.release.outputs.tag }} | ||
|
||
- name: Update manifest.json requirements | ||
if: steps.release.outputs.released == 'true' | ||
uses: jossef/[email protected] | ||
with: | ||
file: custom_components/uk_bin_collection/manifest.json | ||
field: requirements[0] | ||
value: uk-bin-collection>=${{ steps.release.outputs.tag }} | ||
prerelease: true | ||
|
||
- name: Build and publish package | ||
if: steps.release.outputs.released == 'true' | ||
run: | | ||
poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}" | ||
poetry publish --build |
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