🐛 fix: The issue of waiting for export of too many sessions has been … #3
Workflow file for this run
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 Packages | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.target }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: linux | |
| archive: gocrt-decoder-linux-amd64.zip | |
| bin_name: gocrt-decoder | |
| - os: windows-latest | |
| target: windows | |
| archive: gocrt-decoder-windows-amd64.zip | |
| bin_name: gocrt-decoder.exe | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install Linux build dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgl1-mesa-dev xorg-dev | |
| - name: Install Windows build dependencies | |
| if: runner.os == 'Windows' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| install: >- | |
| mingw-w64-x86_64-gcc | |
| - name: Add MinGW to PATH | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Add-Content -Path $env:GITHUB_PATH -Value 'C:\msys64\mingw64\bin' | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Build and package (Linux) | |
| if: runner.os == 'Linux' | |
| env: | |
| CGO_ENABLED: "1" | |
| run: | | |
| mkdir -p dist/linux-amd64 | |
| go build -o dist/linux-amd64/${{ matrix.bin_name }} . | |
| cp README.md LICENSE dist/linux-amd64/ | |
| cd dist | |
| zip -r ${{ matrix.archive }} linux-amd64 | |
| - name: Build and package (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| env: | |
| CGO_ENABLED: "1" | |
| CC: gcc | |
| run: | | |
| New-Item -ItemType Directory -Path dist/windows-amd64 -Force | Out-Null | |
| go build -o dist/windows-amd64/${{ matrix.bin_name }} . | |
| Copy-Item README.md dist/windows-amd64/ | |
| Copy-Item LICENSE dist/windows-amd64/ | |
| Compress-Archive -Path dist/windows-amd64/* -DestinationPath dist/${{ matrix.archive }} -Force | |
| - name: Upload package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package-${{ matrix.target }} | |
| path: dist/${{ matrix.archive }} | |
| if-no-files-found: error | |
| release: | |
| name: Publish Release | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/*.zip | |
| generate_release_notes: true |