Skip to content

Commit

Permalink
Merge pull request #574 from yermak/development
Browse files Browse the repository at this point in the history
Choco build fix
  • Loading branch information
yermak authored May 29, 2024
2 parents e786c2a + d31295d commit 14eba41
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 121 deletions.
2 changes: 2 additions & 0 deletions build/mac/entitlements.plist
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.assets.music.read-write</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion build/windows/chocolaty/audiobookconverter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ AudioBookConverter can work smart to find relevant artwork and can do advanced c

<dependencies>
<dependency id="chocolatey" version="0.10.5" />
<dependency id="ffmpeg" version="4.3.1" />
<dependency id="ffmpeg" version="7.0.1" />
<dependency id="mp4v2" version="4.1.3" />
</dependencies>
</metadata>
Expand Down
247 changes: 132 additions & 115 deletions release-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,122 +11,139 @@ trigger:


variables:
# APP_VERSION: '5.4.$(Build.BuildNumber)'
VERSION: 6.3
# APP_VERSION: '5.4.$(Build.BuildNumber)'
VERSION: 6.4
BUILD_COUNTER: $[counter(variables['VERSION'], 0)]
APP_VERSION: '$(VERSION).$(BUILD_COUNTER)'

jobs:
- job: Build_All

strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
windows:
imageName: 'windows-latest'

pool:
vmImage: $(imageName)

steps:
- checkout: self
clean: 'true'
fetchDepth: '1'
persistCredentials: true

- task: replacetokens@3
inputs:
targetFiles: 'pom.xml,src/main/java/uk/yermak/audiobookconverter/Version.java'
tokenPrefix: '#{'
tokenSuffix: '}#'

- bash: |
wget -q https://download.java.net/openjdk/jdk21/ri/openjdk-21+35_linux-x64_bin.tar.gz
tar -xzf openjdk-21+35_linux-x64_bin.tar.gz
export JAVA_HOME=jdk-21
export JAVAFX_JMODS=jmods/linux
mvn clean package --no-transfer-progress
build/linux/package.sh $JAVA_HOME $JAVAFX_JMODS $(APP_VERSION)
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: 'Build deb package'
- script: |
ECHO ON
choco install 7zip --no-progress
choco install wget --no-progress
wget -q https://download.java.net/openjdk/jdk21/ri/openjdk-21+35_windows-x64_bin.zip
7z.exe x openjdk-21+35_windows-x64_bin.zip
setx JAVA_HOME jdk-21
call refreshenv
SET JAVAFX_JMODS=jmods/windows
call mvn clean package --no-transfer-progress
call build/windows/package.bat "%JAVA_HOME%" %JAVAFX_JMODS% $(APP_VERSION)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Build MSI installers'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'target/release'
ArtifactName: 'AudioBookConverter-$(APP_VERSION)'
publishLocation: 'Container'

- job: Release_Chocolatey
displayName: 'Release to Chocolatey'
dependsOn:
- 'Build_All'
pool:
vmImage: 'windows-latest'

steps:
- checkout: self
clean: 'true'
fetchDepth: '1'
persistCredentials: true
- task: replacetokens@3
inputs:
targetFiles: 'build/windows/chocolaty/audiobookconverter.nuspec,build/windows/chocolaty/tools/chocolateyinstall.ps1'
tokenPrefix: '#{'
tokenSuffix: '}#'

- task: DownloadPipelineArtifact@2
inputs:
artifact: 'AudioBookConverter-$(APP_VERSION)'
targetPath: '$(Pipeline.Workspace)'
- powershell: |
dir '$(Pipeline.Workspace)'
dir '$(System.ArtifactsDirectory)'
$checksum = Get-FileHash -Path $(Pipeline.Workspace)/AudioBookConverter-NoDeps-$(APP_VERSION).msi -Algorithm SHA256 | Select-Object -ExpandProperty Hash
Write-Host "##vso[task.setvariable variable=binary_checksum]$checksum"
displayName: 'Generate Checksum'
- powershell: |
(Get-Content build\windows\chocolaty\tools\chocolateyinstall.ps1) -replace '##yourbinarychecksum##', '$(binary_checksum)' | Set-Content build\windows\chocolaty\tools\chocolateyInstall.ps1
displayName: 'Update chocolateyInstall.ps1 with Checksum'
- script: |
cd build\windows\chocolaty
choco pack audiobookconverter.nuspec
displayName: 'Create Chocolatey Package'
# - task: PublishBuildArtifacts@1
# inputs:
# pathToPublish: build\windows\chocolaty\*.nupkg'
# artifactName: 'drop'
# publishLocation: 'Container'

- script: |
dir build\windows\chocolaty\
echo $(CHOCOLATEY_API_KEY)
choco push build\windows\chocolaty\audiobookconverter.$(APP_VERSION).nupkg --source https://push.chocolatey.org/ --api-key $(CHOCOLATEY_API_KEY)
displayName: 'Push Package to Chocolatey'
env:
CHOCOLATEY_API_KEY: $(CHOCOLATEY_API_KEY)
- job: Build_All

strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
windows:
imageName: 'windows-latest'

pool:
vmImage: $(imageName)

steps:
- checkout: self
clean: 'true'
fetchDepth: '1'
persistCredentials: true

- task: replacetokens@3
inputs:
targetFiles: 'pom.xml,src/main/java/uk/yermak/audiobookconverter/Version.java'
tokenPrefix: '#{'
tokenSuffix: '}#'

- bash: |
wget -q https://download.java.net/openjdk/jdk21/ri/openjdk-21+35_linux-x64_bin.tar.gz
tar -xzf openjdk-21+35_linux-x64_bin.tar.gz
export JAVA_HOME=jdk-21
export JAVAFX_JMODS=jmods/linux
mvn clean package --no-transfer-progress
build/linux/package.sh $JAVA_HOME $JAVAFX_JMODS $(APP_VERSION)
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: 'Build deb package'
- script: |
ECHO ON
choco install 7zip --no-progress
choco install wget --no-progress
wget -q https://download.java.net/openjdk/jdk21/ri/openjdk-21+35_windows-x64_bin.zip
7z.exe x openjdk-21+35_windows-x64_bin.zip
setx JAVA_HOME jdk-21
call refreshenv
SET JAVAFX_JMODS=jmods/windows
call mvn clean package --no-transfer-progress
call build/windows/package.bat "%JAVA_HOME%" %JAVAFX_JMODS% $(APP_VERSION)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Build MSI installers'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'target/release'
ArtifactName: 'AudioBookConverter-$(APP_VERSION)'
publishLocation: 'Container'

- job: Release_GitHub
dependsOn:
- 'Build_All'
pool:
vmImage: 'ubuntu-latest'

steps:
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'AudioBookConverter-$(APP_VERSION)'

- task: GitHubRelease@0
inputs:
gitHubConnection: 'github.com_yermak'
repositoryName: '$(Build.Repository.Name)'
action: 'create' # Options: create, edit, delete
target: '$(Build.SourceVersion)' # Required when action == Create || Action == Edit
tagSource: 'manual' # Required when action == Create# Options: auto, manual
title: 'Release $(APP_VERSION)'
tag: 'version_$(APP_VERSION)'
#releaseNotesSource: 'file' # Optional. Options: file, input
#releaseNotesFile: # Optional
#releaseNotes: # Optional
assets: '$(Pipeline.Workspace)/*' # Optional


- job: Release_Chocolatey
displayName: 'Release to Chocolatey'
dependsOn:
- 'Build_All'
pool:
vmImage: 'windows-latest'

steps:
- checkout: self
clean: 'true'
fetchDepth: '1'
persistCredentials: true
- task: replacetokens@3
inputs:
targetFiles: 'build/windows/chocolaty/audiobookconverter.nuspec,build/windows/chocolaty/tools/chocolateyinstall.ps1'
tokenPrefix: '#{'
tokenSuffix: '}#'

- task: DownloadPipelineArtifact@2
inputs:
artifact: 'AudioBookConverter-$(APP_VERSION)'
targetPath: '$(Pipeline.Workspace)'
- powershell: |
dir '$(Pipeline.Workspace)'
dir '$(System.ArtifactsDirectory)'
$checksum = Get-FileHash -Path $(Pipeline.Workspace)/AudioBookConverter-NoDeps-$(APP_VERSION).msi -Algorithm SHA256 | Select-Object -ExpandProperty Hash
Write-Host "##vso[task.setvariable variable=binary_checksum]$checksum"
displayName: 'Generate Checksum'
- powershell: |
(Get-Content build\windows\chocolaty\tools\chocolateyinstall.ps1) -replace '##yourbinarychecksum##', '$(binary_checksum)' | Set-Content build\windows\chocolaty\tools\chocolateyInstall.ps1
displayName: 'Update chocolateyInstall.ps1 with Checksum'
- script: |
cd build\windows\chocolaty
choco pack audiobookconverter.nuspec
displayName: 'Create Chocolatey Package'
- script: |
choco push build\windows\chocolaty\audiobookconverter.$(APP_VERSION).nupkg --source https://push.chocolatey.org/ --api-key $(CHOCOLATEY_API_KEY)
displayName: 'Push Package to Chocolatey'
env:
CHOCOLATEY_API_KEY: $(CHOCOLATEY_API_KEY)
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public void start(Stage stage) {
stage.setTitle(Version.getVersionString());
stage.setScene(scene);
Screen primary = Screen.getPrimary();
// stage.setMinHeight(primary.getVisualBounds().getHeight() * 0.7);
// stage.setMinWidth(primary.getVisualBounds().getWidth() * 0.4);
stage.setMinHeight(primary.getVisualBounds().getHeight() * 0.7);
stage.setMinWidth(primary.getVisualBounds().getWidth() * 0.4);
env = new JfxEnv(scene, getHostServices());

Settings settings = Settings.loadSetting();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
xmlns:fx="http://javafx.com/fxml"
fx:id="root"
prefWidth="${screen.visualBounds.width * 0.50}"
prefHeight="${screen.visualBounds.height * 0.80}"
>

<fx:define>
Expand Down Expand Up @@ -189,7 +190,7 @@
</Button>

</ToolBar>
<ListView fx:id="progressQueue" VBox.vgrow="ALWAYS"/>
<ListView fx:id="progressQueue" prefHeight="${screen.visualBounds.height * 0.25}" VBox.vgrow="ALWAYS"/>
</VBox>
</Tab>

Expand Down Expand Up @@ -263,7 +264,7 @@
</tooltip>
</Button>
</ToolBar>
<FileListComponent fx:id="fileList" VBox.vgrow="ALWAYS"/>
<FileListComponent fx:id="fileList" prefHeight="${screen.visualBounds.height * 0.25}" VBox.vgrow="ALWAYS"/>
</VBox>
</Tab>
<Tab fx:id="chaptersTab" text="Chapters" closable="false">
Expand Down Expand Up @@ -358,7 +359,7 @@
</Button>

</ToolBar>
<BookStructureComponent fx:id="bookStructure" editable="true" VBox.vgrow="ALWAYS">
<BookStructureComponent fx:id="bookStructure" editable="true" prefHeight="${screen.visualBounds.height * 0.025}" VBox.vgrow="ALWAYS">
<columns>
<TreeTableColumn text="Title" fx:id="chapterColumn" sortable="false"
prefWidth="${screen.visualBounds.width * 0.1}"/>
Expand Down

0 comments on commit 14eba41

Please sign in to comment.