release-python #219
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release to PyPi | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'version override' | |
required: false | |
repository_dispatch: | |
types: [release-python] | |
env: | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
VERSION_OVERRIDE: ${{ github.event.inputs.version }} | |
jobs: | |
release-python: | |
# runs-on: [self-hosted, Linux] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Pip Install | |
run: | | |
pip install twine | |
- name: Release sling-linux-amd64 to PyPi | |
run: | | |
export BASE_FOLDER=sling_base/sling-linux-amd64 | |
export BIN_FOLDER=$BASE_FOLDER/sling_linux_amd64/bin | |
mkdir -p $BIN_FOLDER | |
cd $BIN_FOLDER | |
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_linux_amd64.tar.gz' | |
tar xf sling_linux_amd64.tar.gz | |
mv sling sling-linux-amd64 | |
rm -f *.tar.gz | |
cd - | |
chmod -R 755 $BIN_FOLDER | |
export SLING_VERSION=$( $BIN_FOLDER/sling-linux-amd64 --version | sed 's/Version: //') | |
echo $SLING_VERSION > $BIN_FOLDER/VERSION | |
if [[ $VERSION_OVERRIDE ]] | |
then | |
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION | |
fi | |
cp README.md $BASE_FOLDER/ | |
cd sling_base/sling-linux-amd64 | |
pip install -e . | |
python setup.py sdist && twine upload --verbose --skip-existing dist/* | |
- name: Release sling-linux-arm64 to PyPi | |
run: | | |
export BASE_FOLDER=sling_base/sling-linux-arm64 | |
export BIN_FOLDER=$BASE_FOLDER/sling_linux_arm64/bin | |
mkdir -p $BIN_FOLDER | |
cd $BIN_FOLDER | |
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_linux_arm64.tar.gz' | |
tar xf sling_linux_arm64.tar.gz | |
mv sling sling-linux-arm64 | |
rm -f *.tar.gz | |
cd - | |
chmod -R 755 $BIN_FOLDER | |
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //') | |
echo $SLING_VERSION > $BIN_FOLDER/VERSION | |
if [[ $VERSION_OVERRIDE ]] | |
then | |
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION | |
fi | |
cp README.md $BASE_FOLDER/ | |
cd $BASE_FOLDER | |
pip install -e . | |
python setup.py sdist && twine upload --verbose --skip-existing dist/* | |
- name: Release sling-mac-amd64 to PyPi | |
run: | | |
export BASE_FOLDER=sling_base/sling-mac-amd64 | |
export BIN_FOLDER=$BASE_FOLDER/sling_mac_amd64/bin | |
mkdir -p $BIN_FOLDER | |
cd $BIN_FOLDER | |
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_darwin_amd64.tar.gz' | |
tar xf sling_darwin_amd64.tar.gz | |
mv sling sling-mac-amd64 | |
rm -f *.tar.gz | |
cd - | |
chmod -R 755 $BIN_FOLDER | |
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //') | |
echo $SLING_VERSION > $BIN_FOLDER/VERSION | |
if [[ $VERSION_OVERRIDE ]] | |
then | |
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION | |
fi | |
cp README.md $BASE_FOLDER/ | |
cd $BASE_FOLDER | |
pip install -e . | |
python setup.py sdist && twine upload --verbose --skip-existing dist/* | |
- name: Release sling-mac-arm64 to PyPi | |
run: | | |
export BASE_FOLDER=sling_base/sling-mac-arm64 | |
export BIN_FOLDER=$BASE_FOLDER/sling_mac_arm64/bin | |
mkdir -p $BIN_FOLDER | |
cd $BIN_FOLDER | |
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_darwin_arm64.tar.gz' | |
tar xf sling_darwin_arm64.tar.gz | |
mv sling sling-mac-arm64 | |
rm -f *.tar.gz | |
cd - | |
chmod -R 755 $BIN_FOLDER | |
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //') | |
echo $SLING_VERSION > $BIN_FOLDER/VERSION | |
if [[ $VERSION_OVERRIDE ]] | |
then | |
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION | |
fi | |
cp README.md $BASE_FOLDER/ | |
cd $BASE_FOLDER | |
pip install -e . | |
python setup.py sdist && twine upload --verbose --skip-existing dist/* | |
- name: Release sling-windows-amd64 to PyPi | |
run: | | |
export BASE_FOLDER=sling_base/sling-windows-amd64 | |
export BIN_FOLDER=$BASE_FOLDER/sling_windows_amd64/bin | |
mkdir -p $BIN_FOLDER | |
cd $BIN_FOLDER | |
wget -q 'https://github.com/slingdata-io/sling-cli/releases/latest/download/sling_windows_amd64.tar.gz' | |
tar xf sling_windows_amd64.tar.gz | |
mv sling.exe sling-win-amd64.exe | |
rm -f *.tar.gz | |
cd - | |
chmod -R 755 $BIN_FOLDER | |
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //') | |
echo $SLING_VERSION > $BIN_FOLDER/VERSION | |
if [[ $VERSION_OVERRIDE ]] | |
then | |
echo $VERSION_OVERRIDE > $BIN_FOLDER/VERSION | |
fi | |
cp README.md $BASE_FOLDER/ | |
cd $BASE_FOLDER | |
pip install -e . | |
python setup.py sdist && twine upload --verbose --skip-existing dist/* | |
- name: Release sling to PyPi | |
run: | | |
export SLING_VERSION=$( sling_base/sling-linux-amd64/sling_linux_amd64/bin/sling-linux-amd64 --version | sed 's/Version: //') | |
echo $SLING_VERSION > sling/VERSION | |
if [[ $VERSION_OVERRIDE ]] | |
then | |
echo $VERSION_OVERRIDE > sling/VERSION | |
fi | |
cp README.md sling/ | |
cd sling | |
pip install -e . | |
python setup.py sdist && twine upload --verbose --skip-existing dist/* |