-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from beeware/tag-binary
Add code to tag, build and publish stub binaries.
- Loading branch information
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Update binary | ||
on: | ||
push: | ||
tags: | ||
- '*-b*' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build-stubs: | ||
name: Build stub binaries | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] | ||
steps: | ||
- name: Set Build Variables | ||
env: | ||
TAG_NAME: ${{ github.ref }} | ||
run: | | ||
export TAG=$(basename $TAG_NAME) | ||
export PYTHON_TAG=$(python -c "print('.'.join('${{ matrix.python-version }}'.split('.')[:2]))") | ||
export BRIEFCASE_VERSION="${TAG%-*}" | ||
export BUILD_NUMBER="${TAG#*-}" | ||
echo "TAG=${TAG}" | tee -a $GITHUB_ENV | ||
echo "PYTHON_TAG=${PYTHON_TAG}" | tee -a $GITHUB_ENV | ||
echo "BRIEFCASE_VERSION=${BRIEFCASE_VERSION}" | tee -a $GITHUB_ENV | ||
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a $GITHUB_ENV | ||
- name: Checkout Template | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ "${{ env.BRIEFCASE_VERSION }}" == "dev" ]; then | ||
# We're on the development template; use development Briefcase | ||
python -m pip install git+https://github.com/beeware/briefcase.git | ||
else | ||
python -m pip install briefcase==${{ env.BRIEFCASE_VERSION }} | ||
fi | ||
- name: Generate VisualStudio Stub App | ||
run: | | ||
# Generate the stub app | ||
cd stub | ||
briefcase build windows visualstudio | ||
echo "Build console stub artefact" | ||
mv "./build/console-stub/windows/visualstudio/x64/Release/Console Stub.exe" ./Stub.exe | ||
zip Console-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip Stub.exe | ||
echo "Build GUI stub artefact" | ||
mv "./build/gui-stub/windows/visualstudio/x64/Release/GUI Stub.exe" ./Stub.exe | ||
zip GUI-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip Stub.exe | ||
- name: Upload Release Asset to S3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -U setuptools | ||
python -m pip install awscli | ||
aws s3 cp stub/Console-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ steps.build-vars. outputs.PY_VERSION }}/windows/Console-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip | ||
aws s3 cp stub/GUI-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ steps.build-vars.outputs.PY_VERSION }}/windows/GUI-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[tool.briefcase] | ||
project_name = "Stub" | ||
bundle = "org.beeware" | ||
version = "1.0.0" | ||
license.file = "../LICENSE" | ||
|
||
# Use the current state of this repo as the template. | ||
template = ".." | ||
|
||
[tool.briefcase.app.gui-stub] | ||
formal_name = "GUI Stub" | ||
description = "A stub binary for GUI apps that can be integrated into the Windows app template" | ||
sources = ['src/gui_stub'] | ||
|
||
[tool.briefcase.app.console-stub] | ||
formal_name = "Console Stub" | ||
description = "A stub binary for console apps that can be integrated into the Windows app template" | ||
sources = ['src/console_stub'] | ||
console_app = true |
Empty file.
Empty file.