Skip to content
Merged

15.0 #378

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ blank_issues_enabled: false
contact_links:
- name: Telegram
url: https://t.me/customskinloader
about: Gugugu
- name: QQ
about: Community chat for CustomSkinLoader users.
- name: QQ Group
url: https://jq.qq.com/?_wv=1027&k=vF16R5tg
about: Gugugu
about: Chinese community chat for CustomSkinLoader users.
15 changes: 15 additions & 0 deletions .github/scripts/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
param(
[string] $GradleCommand = "./gradlew.bat"
)

$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest

$ScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$RepositoryRoot = (Resolve-Path -LiteralPath (Join-Path $ScriptRoot "../..")).Path
Set-Location -LiteralPath $RepositoryRoot

& $GradleCommand clean build --stacktrace
if ($LASTEXITCODE -ne 0) {
throw "Gradle build failed with exit code $LASTEXITCODE."
}
51 changes: 51 additions & 0 deletions .github/scripts/install-publish-clis.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest

$RunnerTemp = if ([string]::IsNullOrWhiteSpace($env:RUNNER_TEMP)) {
[System.IO.Path]::GetTempPath()
} else {
$env:RUNNER_TEMP
}

function Add-ActionPath {
param([Parameter(Mandatory = $true)][string] $Path)

$env:Path = "$Path;$env:Path"
if (-not [string]::IsNullOrWhiteSpace($env:GITHUB_PATH)) {
Add-Content -LiteralPath $env:GITHUB_PATH -Value $Path
}
}

if (-not (Get-Command aws -ErrorAction SilentlyContinue)) {
$installer = Join-Path $RunnerTemp "AWSCLIV2.msi"
Invoke-WebRequest -Uri "https://awscli.amazonaws.com/AWSCLIV2.msi" -OutFile $installer
$install = Start-Process msiexec.exe -Wait -PassThru -ArgumentList "/i `"$installer`" /qn"
if ($install.ExitCode -ne 0) {
throw "AWS CLI installer failed with exit code $($install.ExitCode)."
}

$awsCliDir = Join-Path $env:ProgramFiles "Amazon/AWSCLIV2"
$machinePath = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
$userPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
$env:Path = "$awsCliDir;$machinePath;$userPath;$env:Path"
if (-not [string]::IsNullOrWhiteSpace($env:GITHUB_PATH)) {
Add-Content -LiteralPath $env:GITHUB_PATH -Value $awsCliDir
}
}

if (-not (Get-Command coscli -ErrorAction SilentlyContinue)) {
$coscliDir = Join-Path $RunnerTemp "coscli"
New-Item -ItemType Directory -Force -Path $coscliDir | Out-Null
Invoke-WebRequest -Uri "https://github.com/tencentyun/coscli/releases/download/v1.0.8/coscli-v1.0.8-windows-amd64.exe" -OutFile (Join-Path $coscliDir "coscli.exe")
Add-ActionPath $coscliDir
}

if (-not (Get-Command tccli -ErrorAction SilentlyContinue)) {
python -m pip install --user tccli
if ($LASTEXITCODE -ne 0) {
throw "tccli install failed with exit code $LASTEXITCODE."
}

$pythonUserScripts = Join-Path (python -m site --user-base) "Scripts"
Add-ActionPath $pythonUserScripts
}
35 changes: 35 additions & 0 deletions .github/scripts/prepare-build-artifacts.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
param(
[string] $SourcePath = "Bootstrap/build/libs",
[string] $DestinationPath = "build/publish"
)

$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest

$ScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$RepositoryRoot = (Resolve-Path -LiteralPath (Join-Path $ScriptRoot "../..")).Path
Set-Location -LiteralPath $RepositoryRoot

function Resolve-RepoPath {
param([Parameter(Mandatory = $true)][string] $Path)

if ([System.IO.Path]::IsPathRooted($Path)) {
return [System.IO.Path]::GetFullPath($Path)
}

return [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($RepositoryRoot, $Path))
}

$source = Resolve-RepoPath $SourcePath
$destination = Resolve-RepoPath $DestinationPath

New-Item -ItemType Directory -Force -Path $destination | Out-Null

$jars = Get-ChildItem -LiteralPath $source -Filter "CustomSkinLoader_Universal-*.jar" -File |
Where-Object { $_.Name -notlike "*-sources.jar" }

if (-not $jars) {
throw "No Universal jar found under $SourcePath."
}

$jars | Copy-Item -Destination $destination -Force
25 changes: 25 additions & 0 deletions .github/scripts/prepare-publish-artifacts.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
param(
[string] $Channel = $env:PUBLISH_CHANNEL,
[string] $LatestJsonName = $env:LATEST_JSON_NAME,
[string] $DetailJsonName = $env:DETAIL_JSON_NAME
)

$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest

if ([string]::IsNullOrWhiteSpace($Channel)) {
$Channel = "Beta"
}

$publishScript = Join-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) "publish-artifacts.ps1"
$arguments = @("-Channel", $Channel)

if (-not [string]::IsNullOrWhiteSpace($LatestJsonName)) {
$arguments += @("-LatestJsonName", $LatestJsonName)
}

if (-not [string]::IsNullOrWhiteSpace($DetailJsonName)) {
$arguments += @("-DetailJsonName", $DetailJsonName)
}

& $publishScript @arguments
Loading
Loading