Skip to content

Commit

Permalink
Build for x64 and ARM64 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
vineelsai26 authored Nov 6, 2023
1 parent d126bb7 commit 54bd749
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[*.yml]
indent_size = 2
indent_style = space
43 changes: 30 additions & 13 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
APPX_CERTIFICATE_PASSWORD: ${{secrets.APPX_CERTIFICATE_PASSWORD}}
APPX_CERTIFICATE_PASSWORD: ${{ secrets.APPX_CERTIFICATE_PASSWORD }}

permissions:
contents: read
Expand All @@ -18,11 +19,12 @@ jobs:
build:
runs-on: windows-latest
strategy:
matrix:
arch: [arm64,x64]

matrix:
platform: [arm64, x64]
target: [debug, release]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
Expand All @@ -32,29 +34,44 @@ jobs:
with:
python-version: "3.11"

- name: Convert x64 to amd64
id: convert_x64
run: |
if ("${{ matrix.platform }}" -eq "x64") {
"platform=amd64" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
} else {
"platform=${{ matrix.platform }}" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
}
- uses: suisei-cn/actions-download-file@v1.4.0
id: downloadfile # Remember to give an ID if you need the output filename
name: Download rootfs
with:
url: https://github.com/VsTechDev/Fedora-WSL/releases/latest/download/rootfs.${{matrix.arch}}.tar.gz
target: ${{matrix.arch}}
url: https://github.com/VSWSL/Fedora-WSL-RootFS/releases/latest/download/rootfs.${{ steps.convert_x64.outputs.platform }}.tar.gz
target: ${{ matrix.platform }}
filename: rootfs.tar.gz

- name: Write file from base64 string
id: write_file
uses: timheuer/base64-to-file@v1.2
uses: timheuer/base64-to-file@v1
with:
fileName: "FedoraWSL-Appx-Test.pfx"
encodedString: ${{ secrets.APPX_TEST_CERTIFICATE }}

- name: Import certificate
working-directory: ${{env.GITHUB_WORKSPACE}}
working-directory: ${{ github.workspace }}
run: Import-PfxCertificate -FilePath ${{ steps.write_file.outputs.filePath }} -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:APPX_CERTIFICATE_PASSWORD -Force -AsPlainText)

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
working-directory: ${{ github.workspace }}
run: nuget restore ${{ env.SOLUTION_FILE_PATH }}

- name: Build solution
working-directory: ${{env.GITHUB_WORKSPACE}}
run: python build.py --target=build --config=release --platform=${{matrix.arch}}
working-directory: ${{ github.workspace }}
run: python build.py --target=build --config=${{ matrix.target }} --platform=${{ matrix.platform }}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: FedoraWSL-Appx-${{ matrix.platform }}-${{ matrix.target }}
path: AppPackages/FedoraWSL-Appx/FedoraWSL-Appx_*/FedoraWSL-Appx_*.*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,5 @@ FedoraWSL/messages.h
*.lib
*.dll
*.exe
*.tar.gz
*.tar.gz
.DS_Store
2 changes: 1 addition & 1 deletion FedoraWSL-Appx/MyDistro.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp uap2 uap3 rescap desktop">
<Identity Name="22955VineelSai.FedoraWSL" Version="37.0.3.0" Publisher="CN=2881E205-D24D-472D-B367-271A0EA6CC7E" ProcessorArchitecture="x64" />
<Identity Name="22955VineelSai.FedoraWSL" Version="38.0.1.0" Publisher="CN=2881E205-D24D-472D-B367-271A0EA6CC7E" ProcessorArchitecture="x64" />
<Properties>
<DisplayName>Fedora</DisplayName>
<PublisherDisplayName>Vineel Sai</PublisherDisplayName>
Expand Down

0 comments on commit 54bd749

Please sign in to comment.