feat: add CLI for secrets #130
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: build-windows | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
permissions: | |
contents: read | |
jobs: | |
nix-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
source-tag: "v0.32.0" | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- uses: cachix/cachix-action@v15 | |
with: | |
name: codchi | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- run: | | |
nix build .#windows -L | |
cp result/bin/*.exe . | |
nix build .#codchiw-windows -L | |
cp result/bin/*.exe . | |
nix build .#store-wsl.config.build.tarball -L | |
cp result store.tar.gz | |
nix build .#machine-wsl.config.build.tarball -L | |
cp result machine.tar.gz | |
nix build .#busybox -L | |
cp result/bin/busybox busybox | |
# nix build ./build#vcxsrv-bin -L | |
# cp result vcxsrv-installer.exe | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: | | |
*.exe | |
*.tar.gz | |
busybox | |
overwrite: true | |
if-no-files-found: error | |
windows: | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: build | |
needs: | |
- nix-build | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: windows | |
path: build/msix | |
- run: | | |
mkdir -p "msix/VFS/Common AppData/codchi/" | |
mv .\msix\*.tar.gz "msix/VFS/Common AppData/codchi/" | |
mv .\msix\busybox "msix/VFS/Common AppData/codchi/" | |
# .\msix\vcxsrv-installer.exe /S | Out-Null # wait for installer to finish... | |
# mkdir -p "msix/VFS/ProgramFilesX64" | |
# cp -r "${env:ProgramFiles}\VcXsrv" "msix/VFS/ProgramFilesX64" | |
# rm .\msix\vcxsrv-installer.exe | |
# mv .\msix\VFS\ProgramFilesX64\VcXsrv\vcxsrv.exe .\msix\VFS\ProgramFilesX64\VcXsrv\codchi_vcxsrv.exe | |
# - run: | | |
# reg add "HKCU\ROOT\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "[{ProgramFilesX64}]\VcXsrv\codchi_vcxsrv.exe" /t REG_SZ /d "~ HIGHDPIAWARE" | |
# reg save "HKCU\ROOT" .\msix\User.dat | |
# - run: | | |
# & "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22621.0\x64\mt.exe" -manifest msix\vcxsrv.manifest.xml -outputresource:msix\VFS\ProgramFilesX64\VcXsrv\codchi_vcxsrv.exe | |
# rm msix\vcxsrv.manifest.xml | |
- name: Parse Windows Version | |
uses: frabert/replace-string-action@v2 | |
id: winver | |
with: | |
string: '${{ github.ref_name }}' | |
pattern: '^v(\d+).(\d+).(\d+)(\.(\d+))?$' | |
replace-with: '$1.$2.$3$4' | |
- name: Insert version ${{ github.ref_name }} / ${{ steps.winver.outputs.replaced }} | |
env: | |
VERSION: ${{ github.ref_name }} | |
WINVER: ${{ steps.winver.outputs.replaced }} | |
shell: bash | |
run: | | |
for f in msix/{codchi.AppInstaller,AppxManifest.xml}; do | |
sed -i \ | |
"s/@VERSION@/$WINVER/g | |
s/@VERSION_TAG@/$VERSION/g" \ | |
$f | |
done | |
- run: | | |
& "${env:ProgramFiles(x86)}\Windows Kits\10\App Certification Kit\makeappx.exe" pack /o /d .\msix\ /p codchi.msix | |
- name: Azure Trusted Signing | |
uses: azure/[email protected] | |
with: | |
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
endpoint: ${{ secrets.AZURE_ENDPOINT }} | |
code-signing-account-name: ${{ secrets.AZURE_CODE_SIGNING_NAME }} | |
certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }} | |
files-folder: build | |
files-folder-filter: msix | |
file-digest: SHA256 | |
# - if: ${{ failure() }} | |
# uses: mxschmitt/action-tmate@v3 | |
- uses: softprops/action-gh-release@v2 | |
with: | |
prerelease: true | |
fail_on_unmatched_files: true | |
files: | | |
build/codchi.msix | |
build/msix/codchi.AppInstaller |