Build #87
This file contains hidden or 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
| name: Build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| jobs: | |
| createrelease: | |
| name: Create Release | |
| runs-on: [ubuntu-latest] | |
| outputs: | |
| release_id: ${{ steps.create_release.outputs.id }} | |
| steps: | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: true | |
| prerelease: false | |
| - name: Output Release URL File | |
| run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt | |
| - name: Save Release URL File for publish | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release_url | |
| path: release_url.txt | |
| build: | |
| name: Build packages | |
| needs: createrelease | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| TARGET: macos_ARM | |
| CMD_BUILD: poetry run pyinstaller generate_csa_report_mac_arm.spec | |
| OUT_FILE_NAME: lw_report_gen_mac_arm | |
| ASSET_MIME: application/octet-stream | |
| - os: macos-13 | |
| TARGET: macos_X86_64 | |
| CMD_BUILD: poetry run pyinstaller generate_csa_report_mac.spec | |
| OUT_FILE_NAME: lw_report_gen_mac_x86_64 | |
| ASSET_MIME: application/octet-stream | |
| - os: windows-latest | |
| TARGET: windows | |
| CMD_BUILD: poetry run pyinstaller generate_csa_report_win.spec | |
| OUT_FILE_NAME: lw_report_gen_win.exe | |
| ASSET_MIME: application/vnd.microsoft.portable-executable | |
| - os: ubuntu-latest | |
| TARGET: linux | |
| CMD_BUILD: poetry run pyinstaller generate_csa_report_linux.spec | |
| OUT_FILE_NAME: lw_report_gen_linux_x86_64 | |
| ASSET_MIME: application/octet-stream | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: install poetry | |
| run: pipx install poetry | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.10 | |
| cache: 'poetry' | |
| - name: Install python modules | |
| run: | | |
| poetry check | |
| poetry lock --no-update | |
| poetry install --verbose | |
| - name: Update VERSION file | |
| id: update_version | |
| run: | | |
| python ./.github/workflows/ci_bump_version.py ${{ github.ref_name }} | |
| cat ./VERSION | |
| - name: Build with pyinstaller for ${{matrix.TARGET}} | |
| run: ${{matrix.CMD_BUILD}} | |
| - name: Load Release URL File from release job | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release_url | |
| - name: Get Release File Name & Upload URL | |
| id: get_release_info | |
| shell: bash | |
| run: | | |
| value=`cat release_url/release_url.txt` | |
| echo ::set-output name=upload_url::$value | |
| - name: Upload Release Asset | |
| id: upload-release-asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.get_release_info.outputs.upload_url }} | |
| asset_path: ./dist/${{ matrix.OUT_FILE_NAME}} | |
| asset_name: ${{ matrix.OUT_FILE_NAME}} | |
| asset_content_type: ${{ matrix.ASSET_MIME}} | |
| publish: | |
| name: Publish | |
| needs: [createrelease, build] | |
| runs-on: [ubuntu-latest] | |
| steps: | |
| - name: Publish Release | |
| uses: eregon/publish-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| release_id: ${{needs.createrelease.outputs.release_id}} |