From c03bcc4dc2fd93d816d74625f0134f992ffe73a9 Mon Sep 17 00:00:00 2001 From: m2r1k5 Date: Tue, 15 Feb 2022 11:19:28 +0800 Subject: [PATCH] Add Github Workflows --- .github/ISSUE_TEMPLATE/bug_report.md | 29 ++++++++ .github/workflows/deploycf.yml | 73 +++++++++++++++++++ .github/workflows/deploygh.yml | 75 ++++++++++++++++++++ .github/workflows/nightly.yml | 101 +++++++++++++++++++++++++++ .gitignore | 2 + 5 files changed, 280 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/workflows/deploycf.yml create mode 100644 .github/workflows/deploygh.yml create mode 100644 .github/workflows/nightly.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..4b759b1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug report +about: Crashes or unintended behaviors arising from Nomifactory's mods, configurations, + or custom scripts +title: '' +labels: '' +assignees: '' + +--- + +Note: if you need general tech support for things like server configuration, Discord is a better venue. Please open an issue only if there is a clear bug with the pack or if you have been asked to by one of the Discord staff. + +**Pack Version:** +Replace this text with the version number of the pack, or the commit hash (the letters and numbers between "dev-" and "-snapshot" in the zip you downloaded) if you are doing development testing. If you added any additional mods, or changed any configurations from their defaults, please also note that information here. + +**Description:** +Replace this text with a clear and concise description of what the bug is, so we know what the problem is. + +**Expected Behavior:** +Replace this text with a clear and concise description of what the correct behavior would be. + +**Steps To Reproduce:** +Replace this text with steps to reproduce the behavior, if applicable. We need to know how to encounter this bug ourselves to we can diagnose it. + +**Crash Log:** +If your client crashed as a result of this bug, please upload the generated crash log. This is found in your launcher's Nomifactory profile (aka instance) in a folder called `crash-reports`. If there was no crash, but instead an error screen, please upload your `latest.log` instead. + +**Screenshots:** +If applicable, add screenshots to help explain your problem. diff --git a/.github/workflows/deploycf.yml b/.github/workflows/deploycf.yml new file mode 100644 index 0000000..f6db1b3 --- /dev/null +++ b/.github/workflows/deploycf.yml @@ -0,0 +1,73 @@ +name: Deploy to CurseForge +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag to checkout and deploy' + required: true + flavorTitle: + description: 'Flavor title (e. g. "Community Update")' + required: false + +jobs: + deploy: + name: Deploy to CurseForge (${{ github.event.inputs.tag }}) + runs-on: ubuntu-latest + env: + GITHUB_TAG: ${{ github.event.inputs.tag }} + BUILD_FLAVOR_TITLE: ${{ github.event.inputs.flavorTitle }} + + steps: + - name: "Checkout code" + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.tag }} + + - name: "Restore cached files" + uses: actions/cache@v2 + id: cache + with: + path: | + ~/.npm + ./.cache + ./buildtools/node_modules + key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }} + restore-keys: ${{ runner.os }}-bunny- + + - name: "Setup NodeJS v16" + uses: actions/setup-node@v2 + with: + node-version: "16" + check-latest: true + + - name: "Download NPM packages" + working-directory: ./buildtools + run: npm ci + + - name: "Check environmental variables" + working-directory: ./buildtools + run: npx gulp check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }} + CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }} + + - name: "Build everything" + working-directory: ./buildtools + run: npx gulp buildAll + + - name: "Prune cache" + working-directory: ./buildtools + run: npx gulp pruneCache + + - name: "Zip everything" + working-directory: ./buildtools + run: npx gulp zipAll + + - name: "Deploy to CurseForge" + env: + CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }} + CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }} + working-directory: ./buildtools + run: npx gulp deployCurseForge diff --git a/.github/workflows/deploygh.yml b/.github/workflows/deploygh.yml new file mode 100644 index 0000000..89934e7 --- /dev/null +++ b/.github/workflows/deploygh.yml @@ -0,0 +1,75 @@ +name: Deploy to GitHub Releases + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag to checkout and deploy' + required: true + flavorTitle: + description: 'Flavor title (e. g. "Community Update")' + required: false + +jobs: + deploy: + name: Deploy to GitHub Releases (${{ github.event.inputs.tag }}) + runs-on: ubuntu-latest + env: + GITHUB_TAG: ${{ github.event.inputs.tag }} + BUILD_FLAVOR_TITLE: ${{ github.event.inputs.flavorTitle }} + + steps: + - name: "Checkout code" + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.inputs.tag }} + + - name: "Restore cached files" + uses: actions/cache@v2 + id: cache + with: + path: | + ~/.npm + ./.cache + ./buildtools/node_modules + key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }} + restore-keys: ${{ runner.os }}-bunny- + + - name: "Setup NodeJS v16" + uses: actions/setup-node@v2 + with: + node-version: "16" + check-latest: true + + - name: "Download NPM packages" + working-directory: ./buildtools + run: npm ci + + - name: "Check environmental variables" + working-directory: ./buildtools + run: npx gulp check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }} + CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }} + + - name: "Build everything" + working-directory: ./buildtools + run: npx gulp buildAll + + - name: "Prune cache" + working-directory: ./buildtools + run: npx gulp pruneCache + + - name: "Zip everything" + working-directory: ./buildtools + run: npx gulp zipAll + + - name: "Deploy to GitHub Releases" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }} + CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }} + working-directory: ./buildtools + run: npx gulp deployReleases diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..151bbdf --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,101 @@ +name: Nightly Builds + +on: + push: + branches: + - dev + tags-ignore: + - '**' + +jobs: + nightly: + runs-on: ubuntu-latest + + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.8.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/checkout@v2 + - run: git fetch --prune --unshallow --tags --force + + - name: Restore cached files + uses: actions/cache@v2 + id: cache + with: + path: | + ~/.npm + ./.cache + ./buildtools/node_modules + key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }} + restore-keys: ${{ runner.os }}-bunny- + + - name: "Setup NodeJS v16" + uses: actions/setup-node@v2 + with: + node-version: "16" + check-latest: true + + - name: "Download NPM packages" + working-directory: ./buildtools + run: npm ci + + - name: "Check environmental variables" + working-directory: ./buildtools + run: npx gulp check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }} + CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }} + + - name: "Build everything" + working-directory: ./buildtools + run: npx gulp buildAll + + - name: "Prune cache" + working-directory: ./buildtools + run: npx gulp pruneCache + + ## + ## Upload artifacts. + ## + - name: "Make artifact names" + id: artifactNames + working-directory: ./buildtools + run: npx gulp makeArtifactNames + + - name: "Upload client artifact" + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.artifactNames.outputs.client }} + path: | + build/client/**/* + + - name: "Upload server artifact" + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.artifactNames.outputs.server }} + path: | + build/server/**/* + + - name: "Upload lang artifact" + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.artifactNames.outputs.lang }} + path: | + build/lang/**/* + + - name: "Upload changelog artifact" + uses: actions/upload-artifact@v2 + with: + name: changelog + path: | + build/shared/CHANGELOG.md + + - name: "Fire Discord webhook" + working-directory: ./buildtools + run: npx gulp fireNightlyWebhook + env: + GITHUB_RUN_ID: ${{ github.run_id }} + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.gitignore b/.gitignore index a943932..ce57cc7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ overrides/config/brandon3055/ProjectIntelligence overrides/config/brandon3055/ResourceCache build overrides/resources/minecraft/.DS_Store +overrides/resources/.DS_Store +.DS_Store