Skip to content

Commit e38198e

Browse files
committed
Remove support of custom download from gh actions cause need authentication for that
1 parent 2cd9043 commit e38198e

5 files changed

Lines changed: 8 additions & 176 deletions

File tree

‎.github/workflows/RocketModFix.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
name: Rocket.AutoInstaller
7878
path: "./Rocket.AutoInstaller/bin/Release/net461/linux-x64/Rocket.AutoInstaller/"
7979
if-no-files-found: error
80-
80+
8181
- name: Upload Rocket.Unturned.Module
8282
uses: actions/upload-artifact@v4
8383
with:

‎Rocket.AutoInstaller/Installation/GitHubActionsDownloader.cs‎

Lines changed: 0 additions & 96 deletions
This file was deleted.

‎Rocket.AutoInstaller/Installation/GitHubAsset.cs‎

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,7 @@ public class GitHubAsset
2121
public string BrowserDownloadUrl { get; set; }
2222
}
2323

24-
public class GitHubArtifactsResponse
25-
{
26-
[Newtonsoft.Json.JsonProperty("total_count")]
27-
public int TotalCount { get; set; }
28-
29-
[Newtonsoft.Json.JsonProperty("artifacts")]
30-
public GitHubArtifact[] Artifacts { get; set; }
31-
}
32-
33-
public class GitHubArtifact
34-
{
35-
[Newtonsoft.Json.JsonProperty("id")]
36-
public long Id { get; set; }
37-
38-
[Newtonsoft.Json.JsonProperty("name")]
39-
public string Name { get; set; }
40-
41-
[Newtonsoft.Json.JsonProperty("size_in_bytes")]
42-
public long SizeInBytes { get; set; }
43-
44-
[Newtonsoft.Json.JsonProperty("url")]
45-
public string Url { get; set; }
46-
47-
[Newtonsoft.Json.JsonProperty("archive_download_url")]
48-
public string ArchiveDownloadUrl { get; set; }
49-
50-
[Newtonsoft.Json.JsonProperty("expired")]
51-
public bool Expired { get; set; }
52-
53-
[Newtonsoft.Json.JsonProperty("created_at")]
54-
public DateTime CreatedAt { get; set; }
55-
56-
[Newtonsoft.Json.JsonProperty("updated_at")]
57-
public DateTime UpdatedAt { get; set; }
58-
}
59-
60-
public class GitHubRelease
24+
public class GitHubRelease
6125
{
6226
[JsonProperty("url")]
6327
public string Url { get; set; }

‎Rocket.AutoInstaller/Installation/LocalInstaller.cs‎

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,7 @@ public static IEnumerator InstallFromLocalPath(string localPath)
2828

2929
if (GenericUriDownloader.IsUri(localPath))
3030
{
31-
if (GitHubActionsDownloader.IsGitHubActionsUrl(localPath))
32-
{
33-
CommandWindow.Log("GitHub Actions URL detected, downloading...");
34-
yield return DownloadAndProcessGitHubArtifact(localPath, entries => releaseEntries = entries);
35-
}
36-
else
37-
{
38-
CommandWindow.Log("URI detected, downloading...");
39-
yield return DownloadAndProcessGenericUri(localPath, entries => releaseEntries = entries);
40-
}
31+
yield return DownloadAndProcessGenericUri(localPath, entries => releaseEntries = entries);
4132
}
4233
else
4334
{
@@ -183,31 +174,6 @@ private static List<ReleaseEntry> GetReleaseEntriesFromDirectory(string director
183174
return entries;
184175
}
185176

186-
private static IEnumerator DownloadAndProcessGitHubArtifact(string url, Action<List<ReleaseEntry>> onComplete)
187-
{
188-
var entries = new List<ReleaseEntry>();
189-
var downloadSucceeded = false;
190-
var downloadError = string.Empty;
191-
192-
yield return GitHubActionsDownloader.DownloadArtifactFromRun(url,
193-
artifactData => {
194-
entries = GetReleaseEntries(artifactData);
195-
downloadSucceeded = true;
196-
},
197-
error => {
198-
downloadError = error;
199-
downloadSucceeded = false;
200-
});
201-
202-
if (!downloadSucceeded)
203-
{
204-
CommandWindow.LogError($"GitHub Actions failed: {downloadError}");
205-
yield break;
206-
}
207-
208-
onComplete?.Invoke(entries);
209-
}
210-
211177
private static IEnumerator DownloadAndProcessGenericUri(string uri, Action<List<ReleaseEntry>> onComplete)
212178
{
213179
var entries = new List<ReleaseEntry>();

‎Rocket.AutoInstaller/README.md‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,20 @@ For developers who want to test their own builds without manually copying files
4444
```
4545
"CustomInstallPath": "C:\\Builds\\RocketModFix\\Rocket.Unturned"
4646
```
47-
47+
4848
The folder should contain either:
4949
- Rocket.Unturned.dll directly, or
5050
- Rocket.Unturned.Module.zip file, or
5151
- Rocket.Unturned.dll in any subdirectory
5252

53-
3. GitHub Actions URL - Direct link to a GitHub Actions run
54-
```
55-
"CustomInstallPath": "https://github.com/RocketModFix/RocketModFix/actions/runs/17277595277"
56-
```
57-
58-
4. Generic URI - Any HTTP/HTTPS URL pointing to a zip file
53+
3. Direct URI - Any HTTP/HTTPS URL pointing to a zip file
5954
```
6055
"CustomInstallPath": "https://example.com/downloads/Rocket.Unturned.Module.zip"
6156
```
6257

58+
**Note:** GitHub Actions artifacts are currently not supported cause require authentication and aren't suitable for public downloads.
59+
See [GitHub issue #51](https://github.com/actions/upload-artifact/issues/51) for details.
60+
6361
## Features
6462

6563
- Auto-install from GitHub - Downloads latest release automatically

0 commit comments

Comments
 (0)