fix: update executable permissions for Beutl.PackageTools.UI and adju… #33
Workflow file for this run
This file contains 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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
determine-version: | |
runs-on: ubuntu-latest | |
outputs: | |
semVer: ${{ steps.nbgv.outputs.SemVer2 }} | |
nugetVer: ${{ steps.nbgv.outputs.NuGetPackageVersion }} | |
asmVer: ${{ steps.nbgv.outputs.AssemblyFileVersion }} | |
infoVer: ${{ steps.nbgv.outputs.AssemblyInformationalVersion }} | |
simpleVer: ${{ steps.nbgv.outputs.SimpleVersion }} | |
revision: ${{ steps.nbgv.outputs.VersionRevision }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Nerdbank.GitVersioning | |
id: nbgv | |
uses: dotnet/nbgv@v0.4.2 | |
build-executable: | |
needs: [ determine-version ] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rid: [ linux_x64, win_x64, osx_x64, osx_arm64 ] | |
standalone: [ true, false ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Restore | |
run: | | |
chmod +x build.sh | |
./build.sh restore --runtime ${{ matrix.rid }} | |
- name: Publish | |
run: | | |
./build.sh publish \ | |
--self-contained ${{ matrix.standalone }} \ | |
--runtime ${{ matrix.rid }} \ | |
--skip restore \ | |
--version ${{ needs.determine-version.outputs.nugetVer }} \ | |
--assembly-version ${{ needs.determine-version.outputs.asmVer }} \ | |
--informational-version ${{ needs.determine-version.outputs.infoVer }} | |
- if: ${{ matrix.rid == 'linux_x64' }} | |
name: Download libOpenCvSharpExtern.so | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
PACKAGES_JSON=`dotnet list src/Beutl.Engine/Beutl.Engine.csproj package --framework net9.0 --format json` | |
#4.9.0.2024 | |
OPENCVSHARP_VERSION=`echo $PACKAGES_JSON | jq -r '.projects[0].frameworks[0].topLevelPackages | map(select(.id == "OpenCvSharp4"))[0].requestedVersion'` | |
echo $OPENCVSHARP_VERSION | |
#4.9.0 | |
OPENCV_VERSION=`echo $OPENCVSHARP_VERSION | cut -d '.' -f 1-3` | |
echo $OPENCV_VERSION | |
#GitのタグとNuGetのバージョンが違う場合があるので | |
RELEASES_JSON=`gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/shimat/opencvsharp/releases` | |
FILTER='map(select(.tag_name | startswith("'$OPENCV_VERSION'")))[0].tag_name' | |
OPENCVSHARP_TAG=`echo "$RELEASES_JSON" | jq -r "$FILTER"` | |
#ダウンロード | |
RELEASE=`gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/yuto-trd/opencvsharp-extern-builds/releases/tags/$OPENCVSHARP_TAG` | |
ASSET_ID=`echo "$RELEASE" | jq '.assets | map(select(.name == "libOpenCvSharpExtern.so"))[0].id'` | |
cd output/Beutl | |
gh api -H "Accept: application/octet-stream" -H "X-GitHub-Api-Version: 2022-11-28" /repos/yuto-trd/opencvsharp-extern-builds/releases/assets/$ASSET_ID > libOpenCvSharpExtern.so | |
- name: Zip | |
run: | | |
./build.sh zip \ | |
--runtime ${{ matrix.rid }} \ | |
--self-contained ${{ matrix.standalone }} \ | |
--skip publish \ | |
--version ${{ needs.determine-version.outputs.nugetVer }} | |
- name: Save | |
uses: actions/upload-artifact@v4 | |
with: | |
name: beutl-${{ matrix.rid }}${{ matrix.standalone == true && '-standalone' || '' }}-${{ needs.determine-version.outputs.semVer }} | |
path: ./artifacts/*.zip | |
build-windows-installer: | |
needs: [ determine-version, build-executable ] | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
standalone: [ true, false ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- uses: actions/download-artifact@v4 | |
with: | |
name: beutl-win_x64-standalone-${{ needs.determine-version.outputs.semVer }} | |
path: artifacts | |
- name: Extract zip | |
run: | | |
mkdir output/Beutl | |
cd output/Beutl | |
7z x ../../artifacts/beutl-win-x64-standalone-${{ needs.determine-version.outputs.semVer }}.zip | |
- name: Build installer | |
run: | | |
./build.cmd build-installer ` | |
--skip publish ` | |
--self-contained true ` | |
--assembly-version ${{ needs.determine-version.outputs.asmVer }} | |
- name: Save installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: beutl${{ matrix.standalone == true && '-standalone' || '' }}-setup | |
path: ./artifacts/beutl${{ matrix.standalone == true && '-standalone' || '' }}-setup.exe | |
build-debian-package: | |
needs: [ determine-version, build-executable ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- uses: actions/download-artifact@v4 | |
with: | |
name: beutl-linux_x64-${{ needs.determine-version.outputs.semVer }} | |
path: artifacts | |
- name: Extract zip | |
run: | | |
cd packages/ubuntu22.04_amd64/usr | |
mkdir -p lib/beutl | |
cd lib/beutl | |
unzip ${{ github.workspace }}/artifacts/Beutl-linux-x64-${{ needs.determine-version.outputs.semVer }}.zip | |
- name: Change mode | |
run: | | |
cd packages/ubuntu22.04_amd64/usr/lib/beutl | |
chmod +x Beutl | |
chmod +x Beutl.ExceptionHandler | |
chmod +x Beutl.PackageTools.UI | |
chmod +x Beutl.WaitingDialog | |
- name: Symbolic Link | |
run: | | |
cd packages/ubuntu22.04_amd64 | |
mkdir usr/bin | |
ln -s /usr/lib/beutl/Beutl usr/bin/beutl | |
- name: Set Version | |
run: | | |
cd packages/ubuntu22.04_amd64/DEBIAN | |
echo "Version: ${{ needs.determine-version.outputs.simpleVer }}-${{ needs.determine-version.outputs.revision }}ubuntu22.04" >> control | |
- name: Set Installed-Size | |
run: | | |
SizeInKiloBytes=`du -s -k packages/ubuntu22.04_amd64 | awk '{print $1}'` | |
cd packages/ubuntu22.04_amd64/DEBIAN | |
echo "Installed-Size: $SizeInKiloBytes" >> control | |
- name: Build package | |
run: | | |
cd packages | |
fakeroot dpkg-deb --build ubuntu22.04_amd64 . | |
- name: Save package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ubuntu22.04_amd64 | |
path: ./packages/beutl_${{ needs.determine-version.outputs.simpleVer }}-${{ needs.determine-version.outputs.revision }}ubuntu22.04_amd64.deb | |
build-app-bundle: | |
needs: [ determine-version ] | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
rid: [ osx_x64, osx_arm64 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Restore | |
run: | | |
chmod +x build.sh | |
./build.sh Restore --runtime ${{ matrix.rid }} | |
- name: Bundle | |
run: | | |
./build.sh bundle-app \ | |
--runtime ${{ matrix.rid }} \ | |
--skip restore \ | |
--version ${{ needs.determine-version.outputs.nugetVer }} \ | |
--assembly-version ${{ needs.determine-version.outputs.asmVer }} \ | |
--informational-version ${{ needs.determine-version.outputs.infoVer }} | |
- name: Zip | |
run: | | |
mkdir -p artifacts | |
cd output/AppBundle | |
zip ../../artifacts/Beutl.${{ matrix.rid }}.app.zip -r Beutl.app | |
- name: Save | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Beutl_${{ matrix.rid }} | |
path: artifacts/Beutl.${{ matrix.rid }}.app.zip | |
build-nuget: | |
needs: [ determine-version ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Restore | |
run: | | |
chmod +x build.sh | |
./build.sh restore | |
- name: Build & Pack | |
run: | | |
./build.sh nuget-pack --skip restore \ | |
--version ${{ needs.determine-version.outputs.nugetVer }} \ | |
--assembly-version ${{ needs.determine-version.outputs.asmVer }} \ | |
--informational-version ${{ needs.determine-version.outputs.infoVer }} | |
- name: Save | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Packages | |
path: ./artifacts/*.nupkg | |
create-release: | |
needs: [ build-executable, build-windows-installer, build-debian-package, build-nuget, build-app-bundle ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Print | |
run: ls artifacts | |
- uses: ncipollo/release-action@v1 | |
id: create_release | |
with: | |
artifacts: "artifacts/**/*.zip,artifacts/**/*.deb,artifacts/beutl-setup/beutl-setup.exe,artifacts/beutl-standalone-setup/beutl-standalone-setup.exe" | |
draft: true | |
makeLatest: true | |
generateReleaseNotes: true |