Skip to content

Commit

Permalink
feat(ci): rework CI + add github release
Browse files Browse the repository at this point in the history
  • Loading branch information
Skraye committed Dec 3, 2024
1 parent c7e0e74 commit 8aa56fe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ jobs:
with:
python-version: "3.10"

- name: Copy gradle properties
- name: Copy Readme
working-directory: python
run: |
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/gradle.properties > gradle.properties
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/README.md > README.md
- name: Install pypa/build
Expand All @@ -42,6 +41,8 @@ jobs:
- name: Build a binary wheel and a source tarball
if: startsWith(github.ref, 'refs/tags/v')
working-directory: python
env:
VERSION: ${{ github.ref_name }}
run: python -m build --sdist --wheel --outdir dist/ .

- name: Publish distribution to PyPI
Expand Down Expand Up @@ -69,7 +70,7 @@ jobs:
run: |
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/gradle.properties > gradle.properties
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/README.md > README.md
VERSION=$(cat gradle.properties | grep version= | sed "s/^version=//")
VERSION=${{ github.ref_name#v }}
sed -i 's/"version": "0.0.0",/"version": "'$VERSION'",/' package.json
rm gradle.properties
Expand All @@ -88,11 +89,27 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

end:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs:
- pip
- npm
steps:
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false

end:
runs-on: ubuntu-latest
needs:
- release
if: always()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
9 changes: 4 additions & 5 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
from pathlib import Path
import re

version = os.getenv('VERSION', '0.0.0')

setup(
name="kestra",
version=re.search(
"(?m)^version=(.*)$", (Path(__file__).parent / "gradle.properties").read_text()
)
.group(1)
.replace("-SNAPSHOT", ""),
version=version
.replace("v", ""),
package_dir={"": "src"},
include_package_data=True,
install_requires=["requests"],
Expand Down

0 comments on commit 8aa56fe

Please sign in to comment.