Skip to content

Commit

Permalink
ci: add two ci jobs (#48)
Browse files Browse the repository at this point in the history
* ci: py project job

* ci: backport job
  • Loading branch information
aceforeverd authored Dec 30, 2023
1 parent 5db2294 commit 1e7fdb4
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: backport

# backport by issue a label (backport <target branch>) on merged PR

on:
pull_request_target:
types: [closed, labeled]
jobs:
backport:
permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests
name: Backport Pull Request
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Create backport PRs
uses: korthout/backport-action@v2
46 changes: 46 additions & 0 deletions .github/workflows/py.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Python package

# necessary check for Python project, publish to PyPI performed locally

on:
push:
branches:
- main
tags:
- v*
pull_request:
workflow_dispatch:

jobs:
py-package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- run: |
pip install --no-cache-dir poetry
- name: verify
if: startsWith(github.ref, 'refs/tags/v')
run: |
py_version=$(poetry version --short)
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
tag_version=${VERSION#v}
if [[ $py_version != $tag_version ]] ; then
echo "publish version does not match, $py_version vs $tag_version"
exit 1
fi
- name: build
run: |
poetry install
poetry build
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
./openmldb_mixin/openmldb_dashboard.json

0 comments on commit 1e7fdb4

Please sign in to comment.