Skip to content

Commit 0957e58

Browse files
committed
Build the windows binary on windows
Build the intel binary on mac-os-13
1 parent 61a5921 commit 0957e58

File tree

1 file changed

+53
-34
lines changed

1 file changed

+53
-34
lines changed

.github/workflows/distribute-binary-files.yaml

Lines changed: 53 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
workflow_dispatch:
66

77
jobs:
8-
build-binary-files-windows:
9-
runs-on: ubuntu-latest
8+
build-binary-files-windows-and-source-code:
9+
runs-on: windows-latest
1010
steps:
1111
- name: Printing the branch currently working on
1212
run: echo "BRANCH_NAME=${{ matrix.branch-name }}"
@@ -25,6 +25,11 @@ jobs:
2525
pip install -r requirements.txt
2626
pip install pyinstaller # Install pyinstaller
2727
28+
- name: Build source code zip
29+
run: |
30+
Compress-Archive -Path .\* -DestinationPath crdc-datahub-cli-uploader-src.zip
31+
shell: pwsh
32+
2833
- name: Build Windows binary & add configuration files and README.md
2934
run: |
3035
pyinstaller --onefile --distpath dist/windows --name uploader.exe src/uploader.py
@@ -34,7 +39,7 @@ jobs:
3439
- name: Compress Windows binary
3540
run: |
3641
cd dist/windows
37-
zip -r ../../crdc-datahub-cli-uploader-windows.zip .
42+
Compress-Archive -Path .\* -DestinationPath ../../crdc-datahub-cli-uploader-windows.zip
3843
3944
- name: Upload Windows binary to release
4045
uses: actions/upload-release-asset@v1
@@ -46,7 +51,16 @@ jobs:
4651
env:
4752
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4853

49-
build-binary-macOS-files:
54+
- name: Upload source code to release
55+
uses: actions/upload-release-asset@v1
56+
with:
57+
upload_url: ${{ github.event.release.upload_url }}
58+
asset_path: ./crdc-datahub-cli-uploader-src.zip
59+
asset_name: crdc-datahub-cli-uploader-src.zip
60+
asset_content_type: application/zip
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
build-binary-macOS-Apple-Silicon-files:
5064
runs-on: macos-latest # GitHub needs a base runner
5165
steps:
5266
- name: Printing the branch currently working on
@@ -67,16 +81,6 @@ jobs:
6781
pip install -r requirements.txt
6882
pip install pyinstaller # Install pyinstaller
6983
70-
- name: Build source code zip
71-
run: zip -r crdc-datahub-cli-uploader-src.zip .
72-
73-
74-
- name: Build macOS Intel binary & add configuration files and README.md
75-
run: |
76-
pyinstaller --onefile --paths=src/bento --distpath dist/mac-x64 --name uploader src/uploader.py
77-
cp -R configs dist/mac-x64
78-
cp README.md dist/mac-x64
79-
8084
- name: Build macOS Apple Silicon binary & add configuration files and README.md
8185
env:
8286
ARCHFLAGS: "-arch arm64" # Ensures build for Apple Silicon
@@ -85,28 +89,11 @@ jobs:
8589
cp -R configs dist/mac-arm
8690
cp README.md dist/mac-arm
8791
88-
- name: Compress Binary macOS Intel Files
89-
run: |
90-
cd dist/mac-x64
91-
zip -r ../../crdc-datahub-cli-uploader-mac-x64.zip .
92-
shell: bash
93-
9492
- name: Compress Binary Apple Silicon Files
9593
run: |
9694
cd dist/mac-arm
9795
zip -r ../../crdc-datahub-cli-uploader-mac-arm.zip .
9896
shell: bash
99-
100-
- name: Upload macOS Intel binary to release
101-
uses: actions/upload-release-asset@v1
102-
with:
103-
upload_url: ${{ github.event.release.upload_url }}
104-
asset_path: ./crdc-datahub-cli-uploader-mac-x64.zip
105-
asset_name: crdc-datahub-cli-uploader-mac-x64.zip
106-
asset_content_type: application/zip
107-
env:
108-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109-
11097
- name: Upload macOS Apple Silicon binary to release
11198
uses: actions/upload-release-asset@v1
11299
with:
@@ -116,13 +103,45 @@ jobs:
116103
asset_content_type: application/zip
117104
env:
118105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106+
build-binary-macOS-Intel-files:
107+
runs-on: macos-13 # GitHub needs a base runner
108+
steps:
109+
- name: Printing the branch currently working on
110+
run: echo "BRANCH_NAME=${{ matrix.branch-name }}"
111+
- name: Check out the branch
112+
uses: actions/checkout@v2
113+
with:
114+
submodules: true
119115

120-
- name: Upload source code to release
116+
- name: Set up Python
117+
uses: actions/setup-python@v2
118+
with:
119+
python-version: '3.x'
120+
121+
- name: Install dependencies
122+
run: |
123+
python -m pip install --upgrade pip
124+
pip install -r requirements.txt
125+
pip install pyinstaller # Install pyinstaller
126+
127+
- name: Build macOS Intel binary & add configuration files and README.md
128+
run: |
129+
pyinstaller --onefile --paths=src/bento --distpath dist/mac-x64 --name uploader src/uploader.py
130+
cp -R configs dist/mac-x64
131+
cp README.md dist/mac-x64
132+
133+
- name: Compress Binary Apple Intel Files
134+
run: |
135+
cd dist/mac-x64
136+
zip -r ../../crdc-datahub-cli-uploader-mac-x64.zip .
137+
shell: bash
138+
139+
- name: Upload macOS Intel binary to release
121140
uses: actions/upload-release-asset@v1
122141
with:
123142
upload_url: ${{ github.event.release.upload_url }}
124-
asset_path: ./crdc-datahub-cli-uploader-src.zip
125-
asset_name: crdc-datahub-cli-uploader-src.zip
143+
asset_path: ./crdc-datahub-cli-uploader-mac-x64.zip
144+
asset_name: crdc-datahub-cli-uploader-mac-x64.zip
126145
asset_content_type: application/zip
127146
env:
128147
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)