Skip to content

Workflow file for this run

---
name: "Publish turbine-environment-validator"
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches: [ main ]
release:
types:
- published
env:
PACKAGE_NAME: turbine-environment-validator
jobs:
build:
# When using pyinstaller, you want to compile on the oldest OS available
# in order to abuse the backwards-comptabile nature of GLIBC
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04 ]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.6.11'
architecture: 'x64'
- name: Set output
id: vars
run: |
if [ $GITHUB_EVENT_NAME = "pull_request" ]; then
echo ::set-output name=tag::${GITHUB_HEAD_REF}
sed -i "s|placeholder|git+${GITHUB_SHA}|g" turbine_environment_validator/__version__.py
else
echo ::set-output name=tag::${GITHUB_REF#refs/*/}
sed -i "s|placeholder|${GITHUB_REF#refs/*/}|g" turbine_environment_validator/__version__.py
fi
- name: Install Requirements
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade -r requirements.txt
- name: Compile script into binary
working-directory: turbine_environment_validator
run: |
pyinstaller __main__.py --onefile --name turbine-environment-validator
# - name: Upload Artifact for Development
# if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
# uses: actions/upload-artifact@v2
# with:
# name: turbine-environment-validator
# path: turbine_environment_validator/dist/turbine-environment-validator
# retention-days: 5
#
# - name: Get release
# if: ${{ github.event_name == 'release' }}
# id: get_release
# uses: bruceadams/[email protected]
# env:
# GITHUB_TOKEN: ${{ github.token }}
#
# - name: Upload Release Asset
# if: ${{ github.event_name == 'release' }}
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: turbine_environment_validator/dist/turbine-environment-validator
# asset_name: turbine-environment-validator
# asset_content_type: application/octet-stream