Skip to content

Commit dbe19b7

Browse files
authored
Merge pull request #391 from BepInEx/feature-doorstop-4
Restructure project, add Doorstop 4 support, use CoreCLR for Il2Cpp
2 parents ec79ad0 + e8ba62b commit dbe19b7

File tree

137 files changed

+3355
-4066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+3355
-4066
lines changed

.config/dotnet-tools.json

-12
This file was deleted.

.github/workflows/build.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
fetch-depth: 0 # Need to fetch all for proper history
12+
- name: Collect build info
13+
id: info
14+
uses: actions/github-script@v6
15+
with:
16+
script: |
17+
let buildType = "Development";
18+
if (context.ref == "refs/heads/master" && context.repo.owner == "BepInEx") {
19+
buildType = "BleedingEdge";
20+
}
21+
core.setOutput("build_type", buildType);
22+
let shortHash = "";
23+
await exec.exec("git", ["rev-parse", "--short", "HEAD"], {
24+
listeners: {
25+
stdout: d => shortHash += d.toString().trim(),
26+
}
27+
});
28+
core.setOutput("sha_short", shortHash);
29+
core.setOutput("build_id", context.runNumber + 600); // builds.bepinex.dev build numbers start at 500
30+
- uses: nrwl/last-successful-commit-action@v1
31+
id: last_successful_commit
32+
if: ${{ steps.info.outputs.build_type == 'BleedingEdge' && env.GITHUB_TOKEN != null }}
33+
with:
34+
branch: master
35+
workflow_id: build_be.yml
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
- uses: actions/setup-dotnet@v1
38+
with:
39+
dotnet-version: "6.0.x"
40+
- name: Build
41+
run: |
42+
./build.sh --target Publish --build-type ${{ steps.info.outputs.build_type }} --build-id ${{ steps.info.outputs.build_id }} --last-build-commit \"${{ steps.last_successful_commit.outputs.commit_hash }}\" --nuget-api-key \"${{ secrets.BEPIN_DEV_NUGET_KEY }}\"
43+
- name: Upload to BepinBuilds
44+
env:
45+
BEPISBUILDS_HOST: ${{ secrets.BEPISBUILDS_HOST }}
46+
if: ${{ steps.info.outputs.build_type == 'BleedingEdge' && env.BEPISBUILDS_HOST != null }}
47+
run: |
48+
artifacts_list=$(ls ./bin/dist/*.* | tr '\n' ','); artifacts_list=${artifacts_list::-1};
49+
curl --upload-file "{${artifacts_list}}" --ftp-pasv --ftp-skip-pasv-ip --ftp-create-dirs --ftp-method singlecwd --disable-epsv "ftp://${{ secrets.BEPISBUILDS_AUTH }}@${{ secrets.BEPISBUILDS_HOST }}:${{ secrets.BEPISBUILDS_PORT }}/bepinex_be/artifacts/${{ steps.info.outputs.build_id }}/"
50+
- name: Generate changelog
51+
id: generate_changelog
52+
if: ${{ steps.info.outputs.build_type == 'BleedingEdge' }}
53+
run: |
54+
changelog=$(git --no-pager log --no-merges --pretty="format:- (\`%h\`) [%an] %s" ${{ steps.last_successful_commit.outputs.commit_hash }}..HEAD | sed ':a;N;$!ba;s/"/\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
55+
echo "::set-output name=changelog::$changelog"
56+
- name: Notify success
57+
uses: joelwmale/webhook-action@2.1.0
58+
env:
59+
BEPINEX_DISCORD_WEBHOOK: ${{ secrets.BEPINEX_DISCORD_WEBHOOK }}
60+
if: ${{ steps.info.outputs.build_type == 'BleedingEdge' && env.BEPINEX_DISCORD_WEBHOOK != null }}
61+
with:
62+
url: ${{ secrets.BEPINEX_DISCORD_WEBHOOK }}
63+
body: |
64+
{
65+
"embeds": [
66+
{
67+
"title": "BepInEx Bleeding Edge build #${{ steps.info.outputs.build_id }}",
68+
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
69+
"color": 1559874,
70+
"description": "Changelog:\n\n${{ steps.generate_changelog.outputs.changelog }}\n\n[**Artifacts on BepInBuilds**](https://builds.bepinex.dev/projects/bepinex_be)"
71+
}
72+
]
73+
}
74+
- name: Upload Artifacts
75+
uses: actions/upload-artifact@v2.2.4
76+
with:
77+
path: "./bin/dist/*.zip"
78+
name: "BepInEx_CI_${{ steps.info.outputs.build_type }}_${{ steps.info.outputs.sha_short }}_${{ steps.info.outputs.build_id || 0 }}"
79+

.github/workflows/build_be.yml

-86
This file was deleted.

.github/workflows/build_pr.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
name: Build PR
22

33
on:
4-
pull_request:
5-
branches:
6-
- master
4+
pull_request:
5+
branches:
6+
- master
77

88
jobs:
9-
build:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v2.3.5
13-
- uses: actions/setup-dotnet@v1
14-
with:
15-
dotnet-version: "6.0.x"
16-
- name: Build
17-
run: |
18-
./build.sh --target=Pack
19-
- name: Upload Artifacts
20-
uses: actions/upload-artifact@v2.2.4
21-
with:
22-
path: "./bin/dist/*.zip"
23-
name: "BepInEx_CI"
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2.3.5
13+
- uses: actions/setup-dotnet@v1
14+
with:
15+
dotnet-version: "6.0.x"
16+
- name: Build
17+
run: |
18+
./build.sh --target Publish
19+
- name: Upload Artifacts
20+
uses: actions/upload-artifact@v2.2.4
21+
with:
22+
path: "./bin/dist/*.zip"
23+
name: "BepInEx_CI"

.github/workflows/comment_pr.yml

+58-58
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
name: Comment on pull request
22

33
on:
4-
workflow_run:
5-
workflows: ['Build PR']
6-
types: [completed]
4+
workflow_run:
5+
workflows: [ 'Build PR' ]
6+
types: [ completed ]
77

88
jobs:
9-
pr_comment:
10-
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/github-script@v5
14-
with:
15-
# This snippet is public-domain, taken from
16-
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
17-
script: |
18-
async function upsertComment(owner, repo, issue_number, purpose, body) {
19-
const {data: comments} = await github.rest.issues.listComments(
20-
{owner, repo, issue_number});
21-
22-
const marker = `<!-- bot: ${purpose} -->`;
23-
body = marker + "\n" + body;
24-
25-
const existing = comments.filter((c) => c.body.includes(marker));
26-
if (existing.length > 0) {
27-
const last = existing[existing.length - 1];
28-
core.info(`Updating comment ${last.id}`);
29-
await github.rest.issues.updateComment({
30-
owner, repo,
31-
body,
32-
comment_id: last.id,
33-
});
34-
} else {
35-
core.info(`Creating a comment in issue / PR #${issue_number}`);
36-
await github.rest.issues.createComment({issue_number, body, owner, repo});
37-
}
38-
}
39-
40-
const {owner, repo} = context.repo;
41-
const run_id = ${{github.event.workflow_run.id}};
42-
43-
const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};
44-
if (!pull_requests.length) {
45-
return core.error("This workflow doesn't match any pull requests!");
46-
}
47-
48-
const artifacts = await github.paginate(
49-
github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
50-
if (!artifacts.length) {
51-
return core.error(`No artifacts found`);
52-
}
53-
let body = `Download the artifacts for this pull request:\n`;
54-
for (const art of artifacts) {
55-
body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
56-
}
57-
58-
core.info("Review thread message body:", body);
59-
60-
for (const pr of pull_requests) {
61-
await upsertComment(owner, repo, pr.number,
62-
"nightly-link", body);
63-
}
9+
pr_comment:
10+
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/github-script@v5
14+
with:
15+
# This snippet is public-domain, taken from
16+
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
17+
script: |
18+
async function upsertComment(owner, repo, issue_number, purpose, body) {
19+
const {data: comments} = await github.rest.issues.listComments(
20+
{owner, repo, issue_number});
21+
22+
const marker = `<!-- bot: ${purpose} -->`;
23+
body = marker + "\n" + body;
24+
25+
const existing = comments.filter((c) => c.body.includes(marker));
26+
if (existing.length > 0) {
27+
const last = existing[existing.length - 1];
28+
core.info(`Updating comment ${last.id}`);
29+
await github.rest.issues.updateComment({
30+
owner, repo,
31+
body,
32+
comment_id: last.id,
33+
});
34+
} else {
35+
core.info(`Creating a comment in issue / PR #${issue_number}`);
36+
await github.rest.issues.createComment({issue_number, body, owner, repo});
37+
}
38+
}
39+
40+
const {owner, repo} = context.repo;
41+
const run_id = ${{github.event.workflow_run.id}};
42+
43+
const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};
44+
if (!pull_requests.length) {
45+
return core.error("This workflow doesn't match any pull requests!");
46+
}
47+
48+
const artifacts = await github.paginate(
49+
github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
50+
if (!artifacts.length) {
51+
return core.error(`No artifacts found`);
52+
}
53+
let body = `Download the artifacts for this pull request:\n`;
54+
for (const art of artifacts) {
55+
body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
56+
}
57+
58+
core.info("Review thread message body:", body);
59+
60+
for (const pr of pull_requests) {
61+
await upsertComment(owner, repo, pr.number,
62+
"nightly-link", body);
63+
}

BUILDING.md

-52
This file was deleted.

0 commit comments

Comments
 (0)