forked from beeware/briefcase-windows-VisualStudio-template
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (78 loc) · 3.14 KB
/
Copy pathupdate-binary.yml
File metadata and controls
92 lines (78 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Update binary
on:
push:
tags:
- 'b*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build-stubs:
name: Build stub binaries
strategy:
fail-fast: false
matrix:
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
config:
- runner: windows-latest
arch: x64
suffix: '-amd64'
- runner: windows-11-arm
arch: ARM64
suffix: '-arm64'
include:
# GitHub doesn't provide ARM64 binaries for Python 3.10
- python-version: "3.10"
config:
runner: windows-latest
arch: x64
suffix: '-amd64'
runs-on: ${{ matrix.config.runner }}
steps:
- name: Set Build Variables
id: build-vars
env:
TAG_NAME: ${{ github.ref }}
run: |
export BUILD_NUMBER=$(basename $TAG_NAME)
export PYTHON_TAG=$(python -c "print('.'.join('${{ matrix.python-version }}'.split('.')[:2]))")
echo "PYTHON_TAG=${PYTHON_TAG}" | tee -a $GITHUB_ENV
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a $GITHUB_ENV
- name: Checkout Template
uses: actions/checkout@v6.0.2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install git+https://github.com/beeware/briefcase.git
- name: Generate VisualStudio Stub App
run: |
# Generate the stub app
cd stub
briefcase build windows visualstudio
echo "Build ${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }} console stub artefact"
mv "./build/console-stub/windows/visualstudio/${{ matrix.config.arch }}/Release/console-stub.exe" ./Stub.exe
7z a Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip Stub.exe
echo "Build ${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }} GUI stub artefact"
mv "./build/gui-stub/windows/visualstudio/${{ matrix.config.arch }}/Release/GUI Stub.exe" ./Stub.exe
7z a GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip Stub.exe
echo "Stub binaries:"
ls -1 *.zip
- name: Upload Release Asset to S3
if: github.event_name == 'push'
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 }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/Console-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}${{ matrix.config.suffix }}.zip
aws s3 cp stub/GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}.zip s3://briefcase-support/python/${{ env.PYTHON_TAG }}/windows/GUI-Stub-${{ env.PYTHON_TAG }}-${{ env.BUILD_NUMBER }}${{ matrix.config.suffix }}.zip