fixing clipping noise on azure and sherpa-onnx #114
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
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup-msbuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Set up Python 3.11.4 | |
uses: actions/[email protected] | |
with: | |
python-version: "3.11.4" | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Install dependencies | |
run: | | |
poetry install | |
- name: Replace Encryption Key in Multiple Files | |
shell: powershell | |
run: | | |
# Fetch the encryption key from GitHub secrets | |
$encryptionKey = "${{ secrets.CONFIG_ENCRYPTION_KEY }}" | |
# Define paths to the files that need updating | |
$filePaths = @("configure_enc_utils.py") | |
# Loop through each file path and replace the placeholder with the actual encryption key | |
foreach ($filePath in $filePaths) { | |
if (Test-Path $filePath) { | |
# Read the file content | |
$fileContent = Get-Content $filePath | |
# Replace the placeholder with the actual encryption key | |
$updatedContent = $fileContent -replace "YOUR_ENCRYPTION_KEY", $encryptionKey | |
# Write the updated content back to the file | |
Set-Content $filePath -Value $updatedContent | |
Write-Output "Replaced encryption key in $filePath" | |
} else { | |
Write-Output "File not found: $filePath" | |
} | |
} | |
env: | |
CONFIG_ENCRYPTION_KEY: ${{ secrets.CONFIG_ENCRYPTION_KEY }} | |
- name: Inject secrets into environment and encrypt config | |
shell: bash | |
run: | | |
poetry run python configure_enc_utils.py -use-env | |
env: | |
MICROSOFT_TOKEN: ${{ secrets.MICROSOFT_TOKEN }} | |
MICROSOFT_REGION: ${{ secrets.MICROSOFT_REGION }} | |
GOOGLE_CREDS_JSON: ${{ secrets.GOOGLE_CREDS_JSON }} | |
MICROSOFT_TOKEN_TRANS: ${{ secrets.MICROSOFT_TOKEN_TRANS }} | |
CONFIG_ENCRYPTION_KEY: ${{ secrets.CONFIG_ENCRYPTION_KEY }} | |
- name: Build Apps | |
run: | | |
poetry run python -c "import site; print(site.getsitepackages()[0])" | |
.\build_executable.bat | |
env: | |
MICROSOFT_TOKEN: ${{ secrets.MICROSOFT_TOKEN }} | |
MICROSOFT_REGION: ${{ secrets.MICROSOFT_REGION }} | |
GOOGLE_CREDS_JSON: ${{ secrets.GOOGLE_CREDS_JSON }} | |
MICROSOFT_TOKEN_TRANS: ${{ secrets.MICROSOFT_TOKEN_TRANS }} | |
MYAPP_VERSION: ${{ github.ref_name }} | |
- name: Verify Output Directory | |
run: | | |
dir Output | |
- name: Upload Unsigned Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 'UnsignedInstaller' | |
path: 'Output\AACSpeakHelper.exe' | |
sign: | |
runs-on: self-hosted | |
needs: build | |
env: | |
VersionTag: ${{ github.ref_name }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: 'UnsignedInstaller' | |
path: Output | |
- name: Verify Downloaded Artifact | |
run: | | |
dir Output | |
- name: Sign Executable | |
run: signtool sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a ./Output/AACSpeakHelper.exe | |
continue-on-error: true # Allow the workflow to continue even if this step fails | |
- name: Rename Executable | |
if: success() | |
run: | | |
REN Output\AACSpeakHelper.exe AACSpeakHelper-${{env.VersionTag}}.exe | |
- name: Upload Signed Installer if Successful | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SignedInstaller | |
path: Output | |
- name: Upload Unsigned Installer if Signing Fails | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: FailedSignedInstaller | |
path: Output | |
release: | |
runs-on: self-hosted | |
needs: sign | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
VersionTag: ${{ github.ref_name }} | |
steps: | |
- uses: actions/download-artifact@v4 | |
name: Download Signed or Unsigned Installer | |
with: | |
name: SignedInstaller | |
path: Output | |
- name: release | |
if: success() && startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{env.VersionTag}} | |
name: ${{env.VersionTag}} | |
draft: false | |
prerelease: false | |
fail_on_unmatched_files: true | |
files: | | |
Output/AACSpeakHelper-${{env.VersionTag}}.exe |