Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions - Build Release Binaries #46

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/build_release_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Build Release Binaries
on:
release:
types:
- published
branches:
- main
- release/*

permissions:
contents: write

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
Loading