Upload releases #12
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: Upload releases | |
| on: | |
| release: | |
| types: | |
| - created | |
| permissions: | |
| contents: write | |
| env: | |
| RUSTFLAGS: -Ctarget-feature=+crt-static | |
| VCPKG_DEFAULT_TRIPLET: x64-windows-static | |
| VCPKG_DEFAULT_BINARY_CACHE: C:\vcpkg\.cache | |
| VCPKG_COMMIT: ab2977be50c702126336e5088f4836060733c899 | |
| jobs: | |
| build_windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Get the version | |
| id: get_version | |
| run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} | |
| shell: bash | |
| - name: Setup MSBuild.exe | |
| uses: microsoft/[email protected] | |
| with: | |
| msbuild-architecture: x64 | |
| - name: Install gpac | |
| run: choco install gpac --version 2.4.0 | |
| - name: Setup vcpkg | |
| run: mkdir C:\vcpkg\.cache | |
| - name: Cache vcpkg | |
| id: cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| C:\vcpkg\.cache | |
| key: vcpkg-${{ runner.os }}-${{ env.VCPKG_COMMIT }} | |
| - name: Build vcpkg | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg | |
| ./vcpkg/bootstrap-vcpkg.bat | |
| - name: Install dependencies | |
| run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/ | |
| working-directory: windows | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Install Win 10 SDK | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: build Release-Full | |
| env: | |
| LIBCLANG_PATH: "C:\\Program Files\\LLVM\\lib" | |
| LLVM_CONFIG_PATH: "C:\\Program Files\\LLVM\\bin\\llvm-config" | |
| CARGO_TARGET_DIR: "..\\..\\windows" | |
| BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0 | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=x64 | |
| working-directory: ./windows | |
| - name: Copy files to directory for installer | |
| run: mkdir installer; cp ./x64/Release-Full/ccextractorwinfull.exe ./installer; cp ./x64/Release-Full/*.dll ./installer | |
| working-directory: ./windows | |
| - name: install WiX | |
| run: dotnet tool uninstall --global wix; dotnet tool install --global wix --version 6.0.2 && wix extension add -g WixToolset.UI.wixext/6.0.2 | |
| - name: Make sure WiX works | |
| run: wix --version && wix extension list -g | |
| - name: Download Flutter GUI | |
| run: ((Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/CCExtractor/ccextractorfluttergui/releases/latest).Content | ConvertFrom-Json).assets | ForEach-Object {if ($_.name -eq "windows.zip") { Invoke-WebRequest -UseBasicParsing -Uri $_.browser_download_url -OutFile windows.zip}} | |
| working-directory: ./windows | |
| - name: Display contents of dir | |
| run: ls | |
| working-directory: ./windows | |
| - name: Unzip Flutter GUI | |
| run: Expand-Archive -Path ./windows.zip -DestinationPath ./installer -Force | |
| working-directory: ./windows | |
| - name: Display installer folder contents | |
| run: Get-ChildItem -Recurse ./installer | |
| working-directory: ./windows | |
| - name: Create portable zip | |
| run: Compress-Archive -Path ./installer/* -DestinationPath ./CCExtractor_win_portable.zip | |
| working-directory: ./windows | |
| - name: Build installer | |
| run: wix build -ext WixToolset.UI.wixext -d "AppVersion=${{ steps.get_version.outputs.VERSION }}.0.0" -o CCExtractor.msi installer.wxs | |
| working-directory: ./windows | |
| - name: Upload as asset | |
| uses: AButler/[email protected] | |
| with: | |
| files: './windows/CCExtractor.msi;./windows/CCExtractor_win_portable.zip' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| create_linux_package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: ./ccextractor | |
| - name: Create .tar.gz without git and windows folders | |
| run: tar -pczf ./ccextractor_minimal.tar.gz --exclude "ccextractor/windows" --exclude "ccextractor/.git" ccextractor | |
| - name: Upload as asset | |
| uses: AButler/[email protected] | |
| with: | |
| files: './ccextractor_minimal.tar.gz' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} |