Skip to content

Use core24

Use core24 #152

Workflow file for this run

name: Build
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
tags:
- '*'
env:
CARGO_TERM_COLOR: always
jobs:
build-crate:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare_ubuntu
- name: Cargo publish
if: startsWith(github.ref, 'refs/tags/v')
run: cargo publish --token ${{ secrets.CRATES_IO_API_TOKEN }}
build-snap:
runs-on: ubuntu-20.04
if: false
steps:
- uses: actions/checkout@v4
- name: Build snap
uses: snapcore/action-build@v1
id: snapcraft
- name: Archive snap
uses: actions/upload-artifact@v2
with:
name: snap
path: ${{ steps.snapcraft.outputs.snap }}
- name: Snap publish
if: startsWith(github.ref, 'refs/tags/v')
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.UBUNTU_STORE_LOGIN }}
with:
snap: ${{ steps.snapcraft.outputs.snap }}
release: stable
build-windows:
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install FFmpeg
run: |
$VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)
Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n"
Invoke-WebRequest "https://github.com/Futsch1/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.0-latest-win64-gpl-shared-7.0.zip" -OutFile ffmpeg-release-full-shared.zip
7z x ffmpeg-release-full-shared.zip
mkdir ffmpeg
mv ffmpeg-*/* ffmpeg/
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n"
Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n"
- name: Build release
run: cargo build --release
- name: Zip executable files
uses: papeloto/action-zip@v1
with:
files: target\release\image_sieve.exe ffmpeg\bin\avcodec-61.dll ffmpeg\bin\avutil-59.dll ffmpeg\bin\avformat-61.dll ffmpeg\bin\avdevice-61.dll ffmpeg\bin\avfilter-10.dll ffmpeg\bin\swresample-5.dll ffmpeg\bin\swscale-8.dll ffmpeg\bin\postproc-58.dll
dest: image_sieve_Windows_portable.zip
- name: Archive zip for portable installation
uses: actions/upload-artifact@v2
with:
name: windows-portable
path: image_sieve_Windows_portable.zip
- name: Create install package
run: |
$env:PATH += ";$env:WIX\bin"
candle.exe installer\ImageSieve.wxs
light.exe ImageSieve.wixobj -ext WixUIExtension -cultures:en-us
- name: Create msix package
shell: pwsh
run : |
$SOURCE_TAG = ${env:GITHUB_REF} -replace ‘refs/tags/v’, ‘’
if ($SOURCE_TAG -match '\d\d?\.\d\d?\.\d\d?') {
$version = $SOURCE_TAG + ".0"
}
else {
$version = "0.0.0.0"
}
echo "Set version to $version"
((Get-Content -path installer\appmanifest.xml -Raw) -replace 'MSIXVERSION',$version) | Set-Content -Path installer\appmanifest_$version.xml
$sdkToolsPath = Join-Path -Path 'C:\Program Files (x86)\Windows Kits\10\bin' -ChildPath 10.0.19041.0 -AdditionalChildPath x86
$env:Path += ";$sdkToolsPath"
& makeappx.exe pack /m installer\appmanifest_$version.xml /f installer\mapping.txt /p ImageSieve.msix
- name: Signing packages
if: github.event_name != 'pull_request'
shell: pwsh
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.PFX_BASE64 }}")
$currentDirectory = Get-Location
$certificatePath = Join-Path -Path $currentDirectory -ChildPath "MyCertificate.pfx"
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
$sdkToolsPath = Join-Path -Path 'C:\Program Files (x86)\Windows Kits\10\bin' -ChildPath 10.0.19041.0 -AdditionalChildPath x86
$env:Path += ";$sdkToolsPath"
SignTool.exe sign /tr http://timestamp.digicert.com /fd SHA256 /a /f "$certificatePath" /p ${{ secrets.PFX_PRIVATE_KEY }} ImageSieve.msi
- name: Archive install package
uses: actions/upload-artifact@v2
with:
name: windows-installer
path: ImageSieve.msi
- name: Archive msix package
uses: actions/upload-artifact@v2
with:
name: windows-msix
path: ImageSieve.msix
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
artifacts: "*.msix,*.msi,*.zip"
bodyFile: "CHANGELOG.md"
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install ffmpeg
run: brew install ffmpeg
- name: Build
run: cargo build