-
Notifications
You must be signed in to change notification settings - Fork 2
147 lines (131 loc) · 5.06 KB
/
distribute-binary-files.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Build and Attach Binary Files
on:
release:
types: [created]
workflow_dispatch:
jobs:
build-binary-files-windows-and-source-code:
runs-on: windows-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 source code zip
run: |
Compress-Archive -Path .\* -DestinationPath crdc-datahub-cli-uploader-src.zip
shell: pwsh
- 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
Compress-Archive -Path .\* -DestinationPath ../../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 }}
- 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 }}
build-binary-macOS-Apple-Silicon-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 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 Apple Silicon Files
run: |
cd dist/mac-arm
zip -r ../../crdc-datahub-cli-uploader-mac-arm.zip .
shell: bash
- 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 }}
build-binary-macOS-Intel-files:
runs-on: macos-13 # 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 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: Compress Binary Apple Intel Files
run: |
cd dist/mac-x64
zip -r ../../crdc-datahub-cli-uploader-mac-x64.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 }}