Skip to content

Commit

Permalink
💚 update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kitUIN committed Aug 4, 2024
1 parent 0c71400 commit a7350a6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
id: set-matrix
shell: pwsh
run: |
.\matrix.ps1 -path "."
.\matrix.ps1 -path "fabric","forge","neoforge"
test:
runs-on: windows-latest
Expand All @@ -43,7 +43,7 @@ jobs:
./init.ps1
- name: Build
run: |
cd ${{ matrix.mc-loader }}/${{ matrix.mc-loader }}-${{ matrix.mc-version }}
cd ${{ matrix.config.mc-loader }}/${{ matrix.config.mc-loader }}-${{ matrix.config.mc-version }}
./gradlew clean build
cd ../..
- uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
./init.ps1
- name: Build
run: |
cd ${{ matrix.mc-loader }}/${{ matrix.mc-loader }}-${{ matrix.mc-version }}
cd ${{ matrix.config.mc-loader }}/${{ matrix.config.mc-loader }}-${{ matrix.config.mc-version }}
./gradlew clean build
cd ../..
2 changes: 1 addition & 1 deletion .github/workflows/build_forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
./init.ps1
- name: Build
run: |
cd ${{ matrix.mc-loader }}/${{ matrix.mc-loader }}-${{ matrix.mc-version }}
cd ${{ matrix.config.mc-loader }}/${{ matrix.config.mc-loader }}-${{ matrix.config.mc-version }}
./gradlew clean build
cd ../..
2 changes: 1 addition & 1 deletion .github/workflows/build_neoforge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
./init.ps1
- name: Build
run: |
cd ${{ matrix.mc-loader }}/${{ matrix.mc-loader }}-${{ matrix.mc-version }}
cd ${{ matrix.config.mc-loader }}/${{ matrix.config.mc-loader }}-${{ matrix.config.mc-version }}
./gradlew clean build
cd ../..
24 changes: 14 additions & 10 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 14 additions & 11 deletions matrix.ps1
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
param (
[string]$path
[string[]]$paths
)

$folders = Get-ChildItem -Path $path -Directory
$allFolderObjects = @()

$filteredFolders = $folders | Where-Object { $_.Name -ne "origin" -and $_.Name -ne "tool" }
foreach ($path in $paths) {
$folders = Get-ChildItem -Path $path -Directory
$filteredFolders = $folders | Where-Object { $_.Name -ne "origin" }


$folderObjects = $filteredFolders | ForEach-Object {
[PSCustomObject]@{
"mc-version" = $_.Name
"mc-loader" = $path
$folderObjects = $filteredFolders | ForEach-Object {
[PSCustomObject]@{
"mc-version" = $_.Name
"mc-loader" = $path
}
}

$allFolderObjects += $folderObjects
}

$json = [PSCustomObject]@{
"config" = $folderObjects
"config" = $allFolderObjects
} | ConvertTo-Json -Compress

#Write-Output "matrix=$json" >> $GITHUB_OUTPUT
Write-Output "::set-output name=matrix::$json"
Write-Output "::set-output name=matrix::$json"

0 comments on commit a7350a6

Please sign in to comment.