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 542922b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
29 changes: 23 additions & 6 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 All @@ -63,15 +64,15 @@ jobs:
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Set version
id: set_version
run: echo "VERSION=${ github.ref_name#v }" >> $GITHUB_ENV

- name: Copy Readme
working-directory: javascript
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=//")
sed -i 's/"version": "0.0.0",/"version": "'$VERSION'",/' package.json
rm gradle.properties
- name: Install dependencies
working-directory: javascript
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 542922b

Please sign in to comment.