Skip to content

Refactor backend main.py #19

Refactor backend main.py

Refactor backend main.py #19

name: Build and Release needlectl
on:
push:
branches:
- main
paths:
- needlectl/**
jobs:
build-and-release:
runs-on: ubuntu-20.04
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
# Install dependencies and build needlectl
- name: Build needlectl
run: |
cd needlectl
chmod +x build.sh
./build.sh
# Archive the binary
- name: Archive the binary
run: |
mkdir -p release
mv needlectl/dist/needlectl release/
# Create or update the "latest" release
- name: Create or Update Latest Release
id: create_release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: latest
name: "needlectl"
artifacts: release/needlectl
replacesArtifacts: 'true'
allowUpdates: 'true'
# Add an optional step to clean up
- name: Clean up
run: |
rm -rf needlectl/dist needlectl/build needlectl/build_env release