From c550a476f0698062cf6b19a732135c85b75963e5 Mon Sep 17 00:00:00 2001 From: elvzan <95762494+elvzan@users.noreply.github.com> Date: Mon, 25 Mar 2024 13:49:50 -0400 Subject: [PATCH 1/3] Create build_release_binaries.yml --- .github/workflows/build_release_binaries.yml | 88 ++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/build_release_binaries.yml diff --git a/.github/workflows/build_release_binaries.yml b/.github/workflows/build_release_binaries.yml new file mode 100644 index 0000000..63032c7 --- /dev/null +++ b/.github/workflows/build_release_binaries.yml @@ -0,0 +1,88 @@ +name: Build Release Binaries +on: + release: + types: + - published +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 From 2799747af4da7fe15d1af529d730dea815e5c3a9 Mon Sep 17 00:00:00 2001 From: elvzan <95762494+elvzan@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:38:14 -0400 Subject: [PATCH 2/3] Update build_release_binaries.yml Added on release branches restriction --- .github/workflows/build_release_binaries.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_release_binaries.yml b/.github/workflows/build_release_binaries.yml index 63032c7..f0516a6 100644 --- a/.github/workflows/build_release_binaries.yml +++ b/.github/workflows/build_release_binaries.yml @@ -3,6 +3,9 @@ on: release: types: - published + branches: + - main + - release/* jobs: build: From fd67a2260d54e88d5eb46528479911f6fb382ae2 Mon Sep 17 00:00:00 2001 From: elvzan <95762494+elvzan@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:12:39 -0400 Subject: [PATCH 3/3] Update build_release_binaries.yml Added write permissions --- .github/workflows/build_release_binaries.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_release_binaries.yml b/.github/workflows/build_release_binaries.yml index f0516a6..db377a4 100644 --- a/.github/workflows/build_release_binaries.yml +++ b/.github/workflows/build_release_binaries.yml @@ -6,6 +6,10 @@ on: branches: - main - release/* + +permissions: + contents: write + jobs: build: