86 lines
2.9 KiB
YAML
86 lines
2.9 KiB
YAML
name: Build and upload recommended package
|
|
|
|
env:
|
|
TYPE: "recommended"
|
|
DEV_ID: "Developer ID Installer: Clever DevOps Co. (9GQZ7KUFR6)"
|
|
PYTHON_VERSION: "3.8.3"
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- name: Set environment variables
|
|
id: set_env_var
|
|
run: |
|
|
echo ::set-env name=BUILD_DATE::$(/bin/date -u "+%m%d%Y%H%M%S")
|
|
echo ::set-env name=BUILD_DATE_RELEASE::$(/bin/date -u "+%B %d %Y")
|
|
|
|
- name: Checkout python repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install Apple certificates
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: apple-actions/import-codesign-certs@v1
|
|
with:
|
|
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
|
|
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
|
|
|
|
- name: Run build package script
|
|
run: /usr/bin/sudo ./build_python_framework_pkgs.zsh "$TYPE" "$DEV_ID" "$PYTHON_VERSION" "${BUILD_DATE}"
|
|
|
|
- name: Create Release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: v.${{ steps.set_env_var.outputs.BUILD_DATE }}
|
|
release_name: Python ${{env.PYTHON_VERSION}} (${{ steps.set_env_var.outputs.BUILD_DATE_RELEASE }})
|
|
draft: true
|
|
prerelease: true
|
|
|
|
- name: Upload Unsigned Package Release Asset
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
DATE: "${{ steps.current-time.outputs.formattedTime }}"
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./outputs/python_$TYPE-$PYTHON_VERSION.$BUILD_DATE.pkg
|
|
asset_name: python_$TYPE-$PYTHON_VERSION.$BUILD_DATE.pkg
|
|
asset_content_type: application/x-newton-compatible-pkg
|
|
|
|
- name: Upload Signed Package Release Asset
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
DATE: "${{ steps.current-time.outputs.formattedTime }}"
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./outputs/python_$TYPE_signed-$PYTHON_VERSION.$BUILD_DATE.pkg
|
|
asset_name: python_$TYPE_signed-$PYTHON_VERSION.$BUILD_DATE.pkg
|
|
asset_content_type: application/x-newton-compatible-pkg
|
|
|
|
- name: Upload Python Framework Release Asset
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
DATE: "${{ steps.current-time.outputs.formattedTime }}"
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./outputs/Python3.framework_$TYPE-$PYTHON_VERSION.$BUILD_DATE.zip
|
|
asset_name: Python3.framework_$TYPE-$PYTHON_VERSION.$BUILD_DATE.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload packages
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: packages
|
|
path: outputs/
|