Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Merge pull request #39 from cqse/ts/37607_deprecation_notice #139

Merge pull request #39 from cqse/ts/37607_deprecation_notice

Merge pull request #39 from cqse/ts/37607_deprecation_notice #139

Workflow file for this run

name: Build
on:
push:
branches: '*'
tags: 'v*'
pull_request:
branches: '*'
jobs:
build-linux:
name: Linux Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.11'
architecture: 'x64'
- name: Install dependencies
run: pip install .
- name: Run test
run: python setup.py test
# we do not use the available GitHub action as that does not support building
# entrypoints that are not located in the root folder of the repo at the moment
- name: Create binary
run: |
python -m nuitka --assume-yes-for-downloads --standalone --onefile --linux-onefile-icon=/usr/share/pixmaps/python3.xpm teamscale_precommit_client/precommit_client.py
mv precommit_client.bin teamscale-cli
- name: 'Upload Artifact'
if: ${{ always() }}
uses: actions/[email protected]
with:
name: target-linux
path: ./teamscale-cli
retention-days: 5
build-windows:
name: Windows Build
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.11'
architecture: 'x64'
- name: Install dependencies
run: pip install .
- name: Run test
run: python setup.py test
- name: Set up MinGW
# as long as the following pull request is not merged, we need to use its branch instead of the official release.
uses: e-t-l/setup-mingw@patch-1 #official release: egor-tensin/[email protected]
with:
platform: x64
# We do not use --onefile for Windows builds as unpacking the exe to a temp directory
# is _super_ slow on Windows and performance is key for precommit
- name: Create binary
run: |
python -m nuitka --assume-yes-for-downloads --mingw64 --standalone teamscale_precommit_client/precommit_client.py
mv ./precommit_client.dist ./teamscale-cli
mv ./teamscale-cli/precommit_client.exe ./teamscale-cli/teamscale-cli.exe
mkdir target
mv teamscale-cli target
- name: 'Upload Artifact'
if: ${{ always() }}
uses: actions/[email protected]
with:
name: target-windows
path: ./target
retention-days: 5
release:
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build-windows
- build-linux
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: Package
run: |
(cd ./target-linux && chmod +x ./teamscale-cli && zip ../teamscale-cli-linux.zip ./teamscale-cli)
(cd ./target-windows && zip -r ../teamscale-cli-windows.zip .)
- name: Upload Release Assets
id: create_release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: teamscale-cli-*.zip
file_glob: true
overwrite: true