diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..77f7131 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch +# push: +# branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: windows-2019 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Build + run: bash .\ci\windows\ci-windows.sh + + - name: Archive + uses: actions/upload-artifact@v3 + with: + name: brigadier-windows-exe + path: D:\a\brigadier\brigadier\dist + + # Running the command as a test isn't really useful to us yet + # - name: Test + # run: bash .\ci\windows\test.sh diff --git a/ci/windows/ci-windows.sh b/ci/windows/ci-windows.sh new file mode 100755 index 0000000..290e914 --- /dev/null +++ b/ci/windows/ci-windows.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -eux -o pipefail + +PYTHON_VERSION=2.7.18 + +script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd )" +python="/c/hostedtoolcache/windows/Python/${PYTHON_VERSION}/x64/python" + +export PYTHONPATH="${python}" +$python -V +$python -m pip install -r "${script_dir}/requirements.txt" +$python -m pip freeze + +# pip-installed exes will be installed here, so we'll put those at the front +# of the PATH +PATH="/c/hostedtoolcache/windows/Python/${PYTHON_VERSION}/x64/Scripts:$PATH" + +pyinstaller \ + --onefile \ + brigadier diff --git a/ci/windows/requirements.txt b/ci/windows/requirements.txt new file mode 100644 index 0000000..9126f8a --- /dev/null +++ b/ci/windows/requirements.txt @@ -0,0 +1 @@ +pyinstaller==3.6 diff --git a/ci/windows/test.sh b/ci/windows/test.sh new file mode 100644 index 0000000..9fac5f7 --- /dev/null +++ b/ci/windows/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -eux -o pipefail + +whoami + +/d/a/brigadier/brigadier/dist/brigadier -m Macmini4,1 -i