GitHub Actions (#62)

This commit is contained in:
Timothy Sutton 2022-11-09 15:30:13 -05:00 committed by GitHub
parent 90c7eb00f6
commit 35b074b451
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 63 additions and 0 deletions

34
.github/workflows/main.yml vendored Normal file
View file

@ -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

21
ci/windows/ci-windows.sh Executable file
View file

@ -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

View file

@ -0,0 +1 @@
pyinstaller==3.6

7
ci/windows/test.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
set -eux -o pipefail
whoami
/d/a/brigadier/brigadier/dist/brigadier -m Macmini4,1 -i