From 006751d7051de4b5e65fd72166d82662b6a044b2 Mon Sep 17 00:00:00 2001 From: Jozef Volak Date: Tue, 14 Nov 2023 17:46:57 +0100 Subject: [PATCH] Github action for package release --- .github/ISSUE_TEMPLATE/bug.yml | 8 ++++ .github/PULL_REQUEST_TEMPLATE.md | 5 +++ .github/workflows/publish-package.yaml | 54 ++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/publish-package.yaml diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..a57513e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,8 @@ +name: 🐛 Frinx Services Python Workers Bug +description: Report a bug or unexpected behavior in frinx-services-python-workers +labels: [bug, pending] + +body: + - type: markdown + attributes: + value: Thank you for contributing to frinx-services-python-workers! diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..cfa7589 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +#### Checklist + +- [ ] Title of the PR starts with chart name (e.g. `[inventory]`) +- [ ] Update package version in principles of semantic versioning +- [ ] Update CHANGELOG.md diff --git a/.github/workflows/publish-package.yaml b/.github/workflows/publish-package.yaml new file mode 100644 index 0000000..9ea016d --- /dev/null +++ b/.github/workflows/publish-package.yaml @@ -0,0 +1,54 @@ +name: pr-check + +on: + workflow_dispatch: + inputs: + utils: + type: choice + description: Release package from utils + options: + - inventory/python + - resource-manager/python + - schellar/python + - topology-discovery/python + - uniconfig/python + - misc/python/http + - misc/python/kafka + - misc/python/influxdb + - misc/python/conductor-system-test + +jobs: + build: + name: Validate api packages + runs-on: ubuntu-latest + timeout-minutes: 5 + defaults: + run: + working-directory: ${{ inputs.utils }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - uses: abatilo/actions-poetry@v2 + with: + poetry-version: "1.7.0" + - name: Package naming + run: | + echo "PACKAGE_NAME=$(poetry version --no-interaction | cut -d ' ' -f 1)" >> "$GITHUB_ENV" + echo "PACKAGE_VERSION=$(poetry version --no-interaction --short)" >> "$GITHUB_ENV" + echo "RELEASE_TAG=$(poetry version --no-interaction | sed 's| |_v|g')" >> "$GITHUB_ENV" +# - name: Poetry publish +# run: poetry publish -u "__token__" -p "${{ secrets.PYPI_TOKEN }}" --build + - name: Create Release + id: create_release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.PACKAGE_TAG }} + release_name: Release ${{ env.PACKAGE_TAG }} + body: | + - Release of ${{ env.PACKAGE_NAME }} version ${{ env.PACKAGE_VERSION }} + draft: false + prerelease: false