Skip to content

Commit

Permalink
Add release & publish workflows
Browse files Browse the repository at this point in the history
(Copied from greeneye-monitor)
  • Loading branch information
jkeljo committed Aug 30, 2024
1 parent f225655 commit a39998b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Publish

on: # yamllint disable-line rule:truthy
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Publish
uses: JRubics/poetry-publish@v1.17
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Release

on: # yamllint disable-line rule:truthy
push:
branches:
- master
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Dependencies
run: |
pip install poetry
poetry install
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
- name: Get current version
id: get_version
run: echo version=$(poetry version -s) >> $GITHUB_OUTPUT
- uses: mukunku/tag-exists-action@v1.3.0
id: version_exists_check
with:
tag: v${{steps.get_version.outputs.version}}
- name: Release
uses: softprops/action-gh-release@v1
if: steps.version_exists_check.outputs.exists != 'true'
with:
generate_release_notes: true
draft: true
name: ${{steps.get_version.outputs.version}}
tag_name: v${{steps.get_version.outputs.version}}

0 comments on commit a39998b

Please sign in to comment.