From f125f9213ffd91082ab45b59fbe86691a9bc7aa1 Mon Sep 17 00:00:00 2001 From: spencerwooo Date: Tue, 25 Jul 2023 09:43:01 +0000 Subject: [PATCH] ci: publish for github release --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 288c008..a678308 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: lint on: pull_request: push: - branches: [ main ] + branches: [main] workflow_dispatch: jobs: @@ -16,7 +16,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.11" - cache: 'pip' # caching pip dependencies + cache: "pip" # caching pip dependencies - run: pip install -r requirements.txt - name: Ruff linting diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0cb5f0c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: release + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: "pip" # caching pip dependencies + + - name: Set up build tools + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install pyinstaller + + - name: Compile single executable for Linux + run: pyinstaller --onefile --noconfirm --clean --name=bitsrun src/bitsrun/cli.py + + - name: Package binaries + run: | + cd dist + tar -czvf bitsrun.tar.gz bitsrun + cd - + + - name: Upload binaries to GitHub release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/bitsrun.tar.gz + asset_name: bitsrun.tar.gz + tag: ${{ github.ref }} diff --git a/pyproject.toml b/pyproject.toml index 516104e..bdc7bd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "bitsrun" -version = "3.5.2" +version = "3.6.0" description = "A headless login / logout script for 10.0.0.55" authors = [{ name = "spencerwooo", email = "spencer.woo@outlook.com" }] dependencies = [