From 0b3e40807582fb54f453ab06e2128adcff834093 Mon Sep 17 00:00:00 2001 From: Emmanuel BAVOUX Date: Sun, 25 Sep 2022 13:41:49 +0200 Subject: [PATCH 1/2] Adding puslibhing workflow --- .github/workflows/publishing.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/publishing.yaml 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 }} From ccfea2aefaceecaa2ac147c5f342dae988da252d Mon Sep 17 00:00:00 2001 From: Emmanuel BAVOUX Date: Sun, 25 Sep 2022 14:00:28 +0200 Subject: [PATCH 2/2] Creating releasing scripts --- CONTRIBUTING.md | 20 ++++++++++++++++++++ scripts/build.sh | 7 ------- scripts/release.sh | 20 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100755 scripts/build.sh create mode 100644 scripts/release.sh 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