diff --git a/.github/workflows/publishing.yaml b/.github/workflows/publishing.yaml new file mode 100644 index 0000000..d912161 --- /dev/null +++ b/.github/workflows/publishing.yaml @@ -0,0 +1,26 @@ +name: Build & Publish Python Package + +on: + release: + types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7f9df98 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,20 @@ +# Contributing to Superset API Client + +## Setting up your development environment + +To be written + +## Releasing + +> This releasing section is intended for releasers only. +> You won't be able to release without permissions. + +### Before releasing +To release you will need to install github CLI: +1. Install github CLI following the instructions here: https://github.com/cli/cli#installation +2. Authenticate with `gh auth login` and follow the instructions. + +### Creating a new release +To create a new release: +1. Go to master branch and merge develop branch +2. Release using the release script `bash ./scripts/release.sh` diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100755 index 4974a97..0000000 --- a/scripts/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -python -m pip install --upgrade setuptools build -python -m build . - -python -m pip install --upgrade twine -python -m twine upload dist/* diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100644 index 0000000..dbd36c3 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# This script will release a new version of the package +VERSION=$1 + +# Confirming release +echo "Releasing version $VERSION, Continue ?" +select yn in "Yes" "No"; do + case $yn in + Yes ) break;; + No ) exit;; + esac +done + +# Creating tag +git tag $VERSION +git push --tags + +# Creating release from tag +gh release create $VERSION --generate-notes