-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jpmorganchase/github_actions
GitHub actions - Build Release Binaries
- Loading branch information
Showing
1 changed file
with
91 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Build Release Binaries | ||
on: | ||
release: | ||
types: | ||
- published | ||
branches: | ||
- main | ||
- release/* | ||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest", "macos-latest"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Run build | ||
run: | | ||
./build.sh | ||
- name: Create tar/gzip file | ||
run: | | ||
tar czvf porting-advisor-${{github.ref_name}}-${{runner.os}}-${{runner.arch}}.tar.gz -C dist . | ||
ls -l *.tar.gz | ||
- name: Upload Release Asset | ||
if: matrix.os != 'windows-latest' | ||
id: upload-release-asset-release-ubuntu-mac | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: porting-advisor-${{github.ref_name}}-${{runner.os}}-${{runner.arch}}.tar.gz | ||
asset_name: porting-advisor-${{github.ref_name}}-${{runner.os}}-${{runner.arch}}.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
|
||
build-windows: | ||
|
||
runs-on: "windows-latest" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Run build | ||
run: | | ||
.\Build.ps1 | ||
- name: Create zip file | ||
run: | | ||
Compress-Archive -Path dist/* -DestinationPath porting-advisor-${{github.ref_name}}-${{runner.os}}-${{runner.arch}}.zip | ||
dir *.zip | ||
- name: Upload Release Asset | ||
id: upload-release-asset-release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: porting-advisor-${{github.ref_name}}-${{runner.os}}-${{runner.arch}}.zip | ||
asset_name: porting-advisor-${{github.ref_name}}-${{runner.os}}-${{runner.arch}}.zip | ||
asset_content_type: application/zip |