Skip to content

Commit

Permalink
Merge pull request #1 from jpmorganchase/github_actions
Browse files Browse the repository at this point in the history
GitHub actions - Build Release Binaries
  • Loading branch information
elvzan authored Mar 25, 2024
2 parents b890205 + 2799747 commit 3ab5b73
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/build_release_binaries.yml
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

0 comments on commit 3ab5b73

Please sign in to comment.