Skip to content

Commit

Permalink
Merge pull request #46 from BaseMC/develop
Browse files Browse the repository at this point in the history
v0.2.6
  • Loading branch information
litetex authored Dec 19, 2020
2 parents e779f55 + 5fb04d0 commit 1c5583d
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 247 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "03:42"
open-pull-requests-limit: 10
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "03:42"
open-pull-requests-limit: 10
15 changes: 13 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
branches:
- master
- master-release-test
name-template: "v$NEXT_PATCH_VERSION"
tag-template: "v$NEXT_PATCH_VERSION"
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
Expand Down
31 changes: 6 additions & 25 deletions .github/workflows/master-release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:

jobs:
build_release:
name: Base
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_draft.outputs.upload_url }}

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -46,21 +47,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Save Asset Upload URL to File
shell: bash
run: |
echo '${{ steps.create_draft.outputs.upload_url }}' > asset_upload_url.txt
- name: Upload Asset Upload URL - Upload Artifact
uses: actions/upload-artifact@v2
with:
name: asset_upload_url
path: asset_upload_url.txt

build_release_variants:
name: Variant
runs-on: ubuntu-latest
needs: [build_release]

strategy:
matrix:
os: [win-x64, linux-x64, osx-x64]
Expand All @@ -69,26 +60,16 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Download Asset Upload URL - Download Artifact
uses: actions/download-artifact@v1
with:
name: asset_upload_url
path: temp_artf/asset_upload_url

- name: Download ADB - Download Artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: ADB
path: temp_artf/ADB

- name: Unzip ADB
run: unzip temp_artf/ADB/ADB.zip -d build

- name: Fake steps.create_draft.outputs.upload_url from predecessor
id: create_draft
run: echo "::set-output name=upload_url::$(cat temp_artf/asset_upload_url/asset_upload_url.txt)"


- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
Expand All @@ -115,7 +96,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_draft.outputs.upload_url }}
upload_url: ${{ needs.build_release.outputs.upload_url }}
asset_path: ./${{ matrix.project }}/bin/${{ matrix.configuration }}/netcoreapp3.1/${{ matrix.os }}/publish/${{ matrix.project }}.zip
asset_name: ${{ matrix.project }}-${{ matrix.os }}.zip
asset_content_type: application/zip
28 changes: 4 additions & 24 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:

jobs:
build_release:
name: Base
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_draft.outputs.upload_url }}

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -45,17 +46,6 @@ jobs:
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Save Asset Upload URL to File
shell: bash
run: |
echo '${{ steps.create_draft.outputs.upload_url }}' > asset_upload_url.txt
- name: Upload Asset Upload URL - Upload Artifact
uses: actions/upload-artifact@v2
with:
name: asset_upload_url
path: asset_upload_url.txt

build_release_variants:
name: Variant
Expand All @@ -69,25 +59,15 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Download Asset Upload URL - Download Artifact
uses: actions/download-artifact@v1
with:
name: asset_upload_url
path: temp_artf/asset_upload_url

- name: Download ADB - Download Artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: ADB
path: temp_artf/ADB

- name: Unzip ADB
run: unzip temp_artf/ADB/ADB.zip -d build

- name: Fake steps.create_draft.outputs.upload_url from predecessor
id: create_draft
run: echo "::set-output name=upload_url::$(cat temp_artf/asset_upload_url/asset_upload_url.txt)"

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
Expand Down Expand Up @@ -115,7 +95,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_draft.outputs.upload_url }}
upload_url: ${{ needs.build_release.outputs.upload_url }}
asset_path: ./${{ matrix.project }}/bin/${{ matrix.configuration }}/netcoreapp3.1/${{ matrix.os }}/publish/${{ matrix.project }}.zip
asset_name: ${{ matrix.project }}-${{ matrix.os }}.zip
asset_content_type: application/zip
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/schedCheckIntegration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check Integration


on:
schedule:
- cron: '23 1 * * 0'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Download and Prepare
run: |
curl -L https://github.com/BaseMC/Aves/releases/latest/download/Aves-linux-x64.zip -o temp.zip
unzip temp.zip
rm temp.zip
chmod +x Aves
- name: Execute testrun
run: |
./Aves -v LATEST_SNAPSHOT
5 changes: 3 additions & 2 deletions Aves/Config/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;

namespace Aves.Config
Expand Down Expand Up @@ -76,14 +77,14 @@ public class Configuration : JsonConfig
/// <summary>
/// Java Installation Dir
/// <para/>
/// if not set autodetect; default is provided JRE under jre/bin/java.exe
/// if not set autodetect; default is provided JRE under jre/bin/java.exe (win) or jre/bin/java (linux)
/// <para/>
/// if not absloute: relative to <see cref="AppDomain.CurrentDomain.BaseDirectory"/>
/// </summary>
/// <example>
/// "C:\Program Files\Java\jre1.11.0_XXX\bin\java.exe"
/// </example>
public string JavaExePath { get; set; } = Path.Combine("jre", "bin", "java.exe");
public string JavaExePath { get; set; } = Path.Combine("jre", "bin", RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "java.exe" : "java");

/// <summary>
/// Deobfuscator; if not absloute: relative to <see cref="System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName"/>
Expand Down
5 changes: 5 additions & 0 deletions Aves/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ private void Init()

private string TryFindJavaExe()
{
Log.Info("Looking up Java...");

string javaExePath = BuildPathForExecutableLocation(nameof(Config.JavaExePath), Config.JavaExePath);
Log.Info("Checking configuration");
if (!string.IsNullOrEmpty(javaExePath))
{
if (File.Exists(javaExePath))
Expand All @@ -198,6 +201,7 @@ private string TryFindJavaExe()
Log.Warn($"Found location of java[='{javaExePath}'] in configuration, but was invalid. Trying to find java...");
}

Log.Info("Checking env for JAVA_HOME");
javaExePath = Environment.GetEnvironmentVariable("JAVA_HOME");
if (!string.IsNullOrEmpty(javaExePath))
{
Expand All @@ -209,6 +213,7 @@ private string TryFindJavaExe()
}
}

Log.Info("Checking cli");
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Log.Info("Running on commandline[CMD]");
Expand Down
Loading

0 comments on commit 1c5583d

Please sign in to comment.