Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

リリースワークフローを改善 #837

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,41 @@ jobs:
name: beutl-${{matrix.rid}}-${{needs.determine-version.outputs.semVer}}
path: ./artifacts/*.zip

build-windows-installer:
needs: [determine-version, build-executable]
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- uses: actions/download-artifact@v3
with:
name: beutl-win_x64-${{needs.determine-version.outputs.semVer}}
path: artifacts

- name: Extract zip
run: |
mkdir output/Beutl
cd output/Beutl
7z x ../../artifacts/beutl-win-x64-${{needs.determine-version.outputs.semVer}}.zip

- name: Build installer
run: ./build.cmd BuildInstaller --skip Publish

- name: Save installer
uses: actions/upload-artifact@v3
with:
name: beutl-setup
path: ./artifacts/beutl-setup.exe

build-nuget:
needs: [determine-version]
runs-on: windows-latest
Expand Down Expand Up @@ -90,7 +125,7 @@ jobs:
- uses: ncipollo/release-action@v1
id: create_release
with:
artifacts: "artifacts/**/*.zip,artifacts/**/*.nupkg"
artifacts: "artifacts/**/*.zip,artifacts/**/*.nupkg,artifacts/beutl-setup.exe"
draft: true
makeLatest: true
generateReleaseNotes: true
2 changes: 2 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"items": {
"type": "string",
"enum": [
"BuildInstaller",
"Clean",
"Compile",
"Publish",
Expand All @@ -130,6 +131,7 @@
"items": {
"type": "string",
"enum": [
"BuildInstaller",
"Clean",
"Compile",
"Publish",
Expand Down
15 changes: 15 additions & 0 deletions nukebuild/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
using System.Text;
using System.Xml.Linq;

using static Nuke.Common.Tools.InnoSetup.InnoSetupTasks;
using Nuke.Common.Tools.NerdbankGitVersioning;

using Serilog;
using Nuke.Common.Tools.InnoSetup;

partial class Build : NukeBuild
{
Expand Down Expand Up @@ -154,6 +156,19 @@ partial class Build : NukeBuild
mainOutput.CompressTo(ArtifactsDirectory / fileName.ToString());
});

Target BuildInstaller => _ => _
.DependsOn(Publish)
.Executes(() =>
{
InnoSetup(c => c
.SetKeyValueDefinition("MyAppVersion", NerdbankVersioning.AssemblyFileVersion)
.SetKeyValueDefinition("MyOutputDir", ArtifactsDirectory)
.SetKeyValueDefinition("MyLicenseFile", RootDirectory / "LICENSE")
.SetKeyValueDefinition("MySetupIconFile", RootDirectory / "assets/logos/logo.ico")
.SetKeyValueDefinition("MySource", OutputDirectory / "Beutl")
.SetScriptFile(RootDirectory / "nukebuild/beutl-setup.iss"));
});

bool IsSupportedRid(DotNetRuntimeIdentifier rid)
{
return rid == DotNetRuntimeIdentifier.linux_x64
Expand Down
67 changes: 67 additions & 0 deletions nukebuild/beutl-setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Beutl"
; #define MyAppVersion "1.0.0"
; #define MyOutputDir D:\Source\b-editor\beutl-builds\inno-output
; #define MyLicenseFile D:\Source\b-editor\beutl\LICENSE
; #define MySetupIconFile :\Source\b-editor\beutl\src\Beutl\Assets\logo.ico
; #define MySource D:\Source\b-editor\beutl-builds\beutl-win-x64-main-1.0.0-preview.3
#define MyAppPublisher "b-editor"
#define MyAppURL "https://beutl.beditor.net"
#define MyAppExeName "Beutl.exe"
#define MyAppAssocName MyAppName + " Project File"
#define MyAppAssocExt ".bep"
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{5312CE8C-3104-4305-B72F-56D652FA76F6}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
ChangesAssociations=yes
DisableProgramGroupPage=yes
LicenseFile={#MyLicenseFile}
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir={#MyOutputDir}
OutputBaseFilename=beutl-setup
SetupIconFile={#MySetupIconFile}
Compression=lzma
SolidCompression=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "{#MySource}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MySource}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Registry]
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: ""

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

Loading