From d6c990de91f78b7e861bc320e4035de03394d1b5 Mon Sep 17 00:00:00 2001 From: ChickenWithACrown <125937747+ChickenWithACrown@users.noreply.github.com> Date: Wed, 15 Jan 2025 01:33:43 -0800 Subject: [PATCH] Update and rename python-publish.yml to hackercmd.yml --- .github/workflows/hackercmd.yml | 60 ++++++++++++++++++++++++++++ .github/workflows/python-publish.yml | 36 ----------------- 2 files changed, 60 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/hackercmd.yml delete mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/hackercmd.yml b/.github/workflows/hackercmd.yml new file mode 100644 index 0000000..c797748 --- /dev/null +++ b/.github/workflows/hackercmd.yml @@ -0,0 +1,60 @@ +name: HackerCMD CI/CD + +# Trigger the workflow on push to the main branch and pull requests targeting it +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: # Allows manual triggering + +# Define the jobs that run for this workflow +jobs: + build: + runs-on: ubuntu-latest # You can change this to macos-latest or windows-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 # Checks out the code from the repository + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' # Set the Python version you are using + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt # Install dependencies from the requirements.txt file + + - name: Run Tests + run: | + pytest # Replace with your preferred testing framework if needed + + - name: Build Project + run: | + echo "Building HackerCMD..." # Replace with actual build steps if necessary + # For example: python setup.py install + + - name: Deploy to Staging (optional) + run: | + echo "Deploying to staging server..." # Replace with actual deployment steps + if: github.ref == 'refs/heads/main' # Only deploy on the main branch + + # You can add additional jobs like linting, or jobs to run on other platforms: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Run Linting + run: | + pip install flake8 + flake8 . # Runs linting for Python code diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 70dadac..0000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Python package - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - - name: Install dependencies - run: pip install -r requirements.txt - - - name: Run tests - run: pytest - - - name: Build package - run: python setup.py sdist bdist_wheel - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }}