Build and Attach Binary Files #4
Workflow file for this run
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
name: Build and Attach Binary Files | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build-binary-files-windows: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Printing the branch currently working on | |
run: echo "BRANCH_NAME=${{ matrix.branch-name }}" | |
- name: Check out the branch | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pyinstaller # Install pyinstaller | |
- name: Build Windows binary & add configuration files and README.md | |
run: | | |
pyinstaller --onefile --distpath dist/windows --name uploader.exe src/uploader.py | |
cp -R configs dist/windows | |
cp README.md dist/windows | |
- name: Compress Windows binary | |
run: | | |
cd dist/windows | |
zip -r ../../crdc-datahub-cli-uploader-windows.zip . | |
- name: Upload Windows binary to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./crdc-datahub-cli-uploader-windows.zip | |
asset_name: crdc-datahub-cli-uploader-windows.zip | |
asset_content_type: application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-binary-macOS-files: | |
runs-on: macos-latest # GitHub needs a base runner | |
steps: | |
- name: Printing the branch currently working on | |
run: echo "BRANCH_NAME=${{ matrix.branch-name }}" | |
- name: Check out the branch | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pyinstaller # Install pyinstaller | |
- name: Build source code zip | |
run: zip -r crdc-datahub-cli-uploader-src.zip . | |
- name: Build macOS Intel binary & add configuration files and README.md | |
run: | | |
pyinstaller --onefile --paths=src/bento --distpath dist/mac-x64 --name uploader src/uploader.py | |
cp -R configs dist/mac-x64 | |
cp README.md dist/mac-x64 | |
- name: Build macOS Apple Silicon binary & add configuration files and README.md | |
env: | |
ARCHFLAGS: "-arch arm64" # Ensures build for Apple Silicon | |
run: | | |
pyinstaller --onefile --paths=src/bento --distpath dist/mac-arm --name uploader src/uploader.py | |
cp -R configs dist/mac-arm | |
cp README.md dist/mac-arm | |
- name: Compress Binary macOS Intel Files | |
run: | | |
cd dist/mac-x64 | |
zip -r ../../crdc-datahub-cli-uploader-mac-x64.zip . | |
shell: bash | |
- name: Compress Binary Apple Silicon Files | |
run: | | |
cd dist/mac-arm | |
zip -r ../../crdc-datahub-cli-uploader-mac-arm.zip . | |
shell: bash | |
- name: Upload macOS Intel binary to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./crdc-datahub-cli-uploader-mac-x64.zip | |
asset_name: crdc-datahub-cli-uploader-mac-x64.zip | |
asset_content_type: application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload macOS Apple Silicon binary to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./crdc-datahub-cli-uploader-mac-arm.zip | |
asset_name: crdc-datahub-cli-uploader-mac-arm.zip | |
asset_content_type: application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload source code to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./crdc-datahub-cli-uploader-src.zip | |
asset_name: crdc-datahub-cli-uploader-src.zip | |
asset_content_type: application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |