-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI workflows to tag new binaries.
- Loading branch information
1 parent
2ec160a
commit 189ca80
Showing
1 changed file
with
23 additions
and
54 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 |
---|---|---|
|
@@ -49,67 +49,36 @@ jobs: | |
# Generate the stub app | ||
cd stub | ||
briefcase build macOS Xcode | ||
echo "Gather compiled binaries" | ||
mv "./build/console-stub/macos/xcode/build/Release/Console Stub.app/Contents/MacOS/Console Stub" Console-Stub | ||
mv "./build/gui-stub/macos/xcode/build/Release/GUI Stub.app/Contents/MacOS/GUI Stub" GUI-Stub | ||
echo "Strip signatures" | ||
# Since the project is producing generic stub binary, we can't provide | ||
# any meaningful signing credentials in the Xcode project. Remove the | ||
# signature from the stub binaries. | ||
codesign --remove-signature "./build/console-stub/macos/xcode/build/Release/Console Stub.app/Contents/MacOS/Console Stub" | ||
codesign --remove-signature "./build/gui-stub/macos/xcode/build/Release/GUI Stub.app/Contents/MacOS/GUI Stub" | ||
echo "Move the binaries into the final location" | ||
mv "./build/console-stub/macos/xcode/build/Release/Console Stub.app/Contents/MacOS/Console Stub" Console-Stub-${{ env.PYTHON_TAG }} | ||
mv "./build/gui-stub/macos/xcode/build/Release/GUI Stub.app/Contents/MacOS/GUI Stub" GUI-Stub-${{ env.PYTHON_TAG }} | ||
codesign --remove-signature Console-Stub | ||
codesign --remove-signature GUI-Stub | ||
echo "Compress distribution artefacts" | ||
zip Console-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip Console-Stub | ||
zip GUI-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip GUI-Stub | ||
- name: Upload Stub Artefact | ||
- name: Upload Stub Artefact to Release | ||
uses: actions/[email protected] | ||
with: | ||
name: stub-${{ matrix.python-version }} | ||
path: stub/*-Stub-${{ env.PYTHON_TAG }} | ||
name: stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }} | ||
path: stub/*-Stub | ||
|
||
commit-stubs: | ||
name: Commit stub binaries | ||
needs: build-stubs | ||
runs-on: macos-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#*-}" | ||
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 | ||
python -m pip install -U pip | ||
python -m pip install -U setuptools | ||
python -m pip install awscli | ||
- name: Commit stubs | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Brutus (robot)" | ||
# Move the binary into it's final location | ||
mv stub/*-Stub-* "{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}.app/Contents/MacOS" | ||
# Ensure the binary is executable | ||
cd "{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}.app/Contents/MacOS" | ||
chmod 755 *-Stub-* | ||
# Commit changes | ||
git add ./*-Stub-* | ||
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 }}/macOS/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 }}/macOS/GUI-Stub-${{ env.PYTHON_TAG }}-${{ steps.build-vars.outputs.BUILD_NUMBER }}.zip |