Skip to content
Merged
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
94 changes: 90 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Build GTNH Mod
on:
push:
branches: [ "**" ]
tags: [ "v*" ]
tags: [ "v*", "*test*" ]
pull_request:
branches: [ master, main ]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
contents: read
pull-requests: read

steps:
Expand All @@ -37,10 +37,96 @@ jobs:
path: build/libs/*.jar
if-no-files-found: error

- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
release-stable:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: mod-jar
path: build/libs

- name: Create stable release
uses: softprops/action-gh-release@v2
with:
files: |
build/libs/*[!s].jar
generate_release_notes: true

release-test:
needs: build
if: startsWith(github.ref, 'refs/tags/') && contains(github.ref_name, 'test')
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: test-prerelease-release
cancel-in-progress: true

steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: mod-jar
path: build/libs

- name: Delete previous rolling test prerelease
uses: actions/github-script@v7
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const rollingTag = 'test-latest';

try {
const release = await github.rest.repos.getReleaseByTag({
owner,
repo,
tag: rollingTag,
});

core.info(`Deleting existing release ${release.data.id} for ${rollingTag}`);
await github.rest.repos.deleteRelease({
owner,
repo,
release_id: release.data.id,
});
} catch (error) {
if (error.status !== 404) {
throw error;
}
core.info(`No existing release found for ${rollingTag}`);
}

try {
await github.rest.git.deleteRef({
owner,
repo,
ref: `tags/${rollingTag}`,
});
core.info(`Deleted existing ref tags/${rollingTag}`);
} catch (error) {
if (error.status !== 404 && error.status !== 422) {
throw error;
}
core.info(`No existing ref to delete for tags/${rollingTag}`);
}

- name: Create rolling test prerelease
uses: softprops/action-gh-release@v2
with:
tag_name: test-latest
name: Test Build
prerelease: true
target_commitish: ${{ github.sha }}
body: |
Rolling prerelease updated from source tag `${{ github.ref_name }}`.

Commit: `${{ github.sha }}`
files: |
build/libs/*[!s].jar
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ public class BlacklistFilter implements IRecipeFilter {
private final ExplicitStackMatcher matcher;

public BlacklistFilter(String keyword, boolean checkInputs, boolean checkOutputs) {
this(keyword, checkInputs, checkOutputs, new ExplicitStackMatcher.StackMatchCache());
}

BlacklistFilter(String keyword, boolean checkInputs, boolean checkOutputs,
ExplicitStackMatcher.StackMatchCache stackMatchCache) {
this.keyword = keyword;
this.checkInputs = checkInputs;
this.checkOutputs = checkOutputs;
this.matcher = new ExplicitStackMatcher(keyword);
this.matcher = new ExplicitStackMatcher(keyword, stackMatchCache);
}

@Override
Expand Down
Loading
Loading