-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to upload stub binaries to S3.
- Loading branch information
1 parent
cd655ba
commit 286536c
Showing
1 changed file
with
19 additions
and
48 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 |
---|---|---|
|
@@ -53,58 +53,29 @@ jobs: | |
# Generate the stub app | ||
cd stub | ||
briefcase build windows visualstudio | ||
echo "Move the binaries into the final location" | ||
mv ./build/console-stub/windows/visualstudio/x64/Release/console-stub.exe ./Console-Stub-${{ env.PYTHON_TAG }}.exe | ||
mv "./build/gui-stub/windows/visualstudio/x64/Release/GUI stub.exe" ./GUI-Stub-${{ env.PYTHON_TAG }}.exe | ||
- name: Upload Stub Artefact | ||
echo "Gather compiled binaries" | ||
mv "./build/console-stub/windows/visualstudio/x64/Release/Console Stub.exe" ./Console-Stub.exe | ||
mv "./build/gui-stub/windows/visualstudio/x64/Release/GUI Stub.exe" ./GUI-Stub.exe | ||
echo "Compress distribution artefacts" | ||
zip Console-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip Console-Stub.exe | ||
zip GUI-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip GUI-Stub.exe | ||
- name: Upload Stub Artefact to release | ||
uses: actions/[email protected] | ||
with: | ||
name: stub-${{ matrix.python-version }} | ||
path: stub/*-Stub-${{ env.PYTHON_TAG }}.exe | ||
name: stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }} | ||
path: stub/*-Stub.exe | ||
|
||
commit-stubs: | ||
name: Commit Stub Binaries | ||
needs: build-stubs | ||
runs-on: windows-latest | ||
steps: | ||
- name: Set Build Variables | ||
- name: Upload Release Asset to S3 | ||
env: | ||
TAG_NAME: ${{ github.ref }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
export TAG=$(basename $TAG_NAME) | ||
export BRIEFCASE_VERSION="${TAG%-*}" | ||
export BUILD_NUMBER="${TAG#*-}" | ||
python -m pip install -U pip | ||
python -m pip install -U setuptools | ||
python -m pip install awscli | ||
echo "TAG=${TAG}" | tee -a $GITHUB_ENV | ||
echo "BRIEFCASE_VERSION=${BRIEFCASE_VERSION}" | tee -a $GITHUB_ENV | ||
echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a $GITHUB_ENV | ||
if [ "${BRIEFCASE_VERSION}" == "dev" ]; then | ||
# We're on the development template; push to main | ||
echo "TEMPLATE_BRANCH=main" | tee -a $GITHUB_ENV | ||
else | ||
echo "TEMPLATE_BRANCH=v${BRIEFCASE_VERSION}" | tee -a $GITHUB_ENV | ||
fi | ||
- name: Checkout Template | ||
uses: actions/[email protected] | ||
|
||
- name: Download Stub Artefacts | ||
uses: actions/[email protected] | ||
with: | ||
pattern: stub-* | ||
path: stub | ||
merge-multiple: true | ||
|
||
- name: Commit Stubs | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Brutus (robot)" | ||
# Move the binaries into their final location | ||
mv stub/*-Stub-* "{{ cookiecutter.format }}/src" | ||
git add "{{ cookiecutter.format }}/src" | ||
git commit -m "AUTO: Update app binaries; build ${{ env.TAG }}" | ||
git push origin HEAD:${{ env.TEMPLATE_BRANCH }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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 |