95 lines
3.0 KiB
YAML
95 lines
3.0 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: Get current time
|
|
uses: srfrnk/current-time@master
|
|
id: current-time
|
|
with:
|
|
format: MMDDYYYYHHmmss
|
|
|
|
- name: Use current time
|
|
env:
|
|
DATE: "${{ steps.current-time.outputs.time }}"
|
|
F_DATE: "${{ steps.current-time.outputs.formattedTime }}"
|
|
run: echo $DATE $F_DATE
|
|
|
|
- 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 (recommended pkg)
|
|
env:
|
|
DATE: "${{ steps.current-time.outputs.formattedTime }}"
|
|
run: /usr/bin/sudo ./build_python_framework_pkgs.zsh "$TYPE" "$DEV_ID" "$PYTHON_VERSION" "{DATE}"
|
|
|
|
- name: Create Release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
DATE: "${{ steps.current-time.outputs.formattedTime }}"
|
|
with:
|
|
tag_name: ${{ DATE }}
|
|
release_name: Python ${{PYTHON_VERSION}} (${{ github.ref }})
|
|
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.$DATE.pkg
|
|
asset_name: python_$TYPE-$PYTHON_VERSION.$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.$DATE.pkg
|
|
asset_name: python_$TYPE_signed-$PYTHON_VERSION.$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.$DATE.zip
|
|
asset_name: Python3.framework_$TYPE-$PYTHON_VERSION.$DATE.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload packages
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: packages
|
|
path: outputs/
|