forked from Ecks1337/RyuSAK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
4,168 additions
and
13,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'wip*' | ||
|
||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup NodeJS environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14.20.0 | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm clean-install --include=dev | ||
|
||
- name: Dump title IDs from Tinfoil DB | ||
run: npm run tinfoil | ||
|
||
- name: Dump eShop data | ||
run: npm run eshop | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
# If the action trigger was NOT a version tag | ||
- name: Upload artifact | ||
if: startsWith(github.ref, 'refs/tags/v') == false | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.os }} | ||
path: out/**/* | ||
|
||
# If the action trigger was a version tag | ||
- name: Make distributables | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: npm run make | ||
|
||
- name: Publish to Releases | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
files: out/make/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Comment artifacts links on PRs | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['Build'] | ||
types: [completed] | ||
|
||
jobs: | ||
pr_comment: | ||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { owner, repo } = context.repo; | ||
const run_id = ${{github.event.workflow_run.id}}; | ||
const pull_head_sha = "${{github.event.workflow_run.head_sha}}"; | ||
const issue_number = await (async () => { | ||
const pulls = await github.rest.pulls.list({owner, repo}); | ||
for await (const { data } of github.paginate.iterator(pulls)) { | ||
for (const pull of data) { | ||
if (pull.head.sha === pull_head_sha) { | ||
return pull.number; | ||
} | ||
} | ||
} | ||
})(); | ||
if (issue_number) { | ||
core.info(`Matched pull request ${issue_number}`); | ||
} else { | ||
return core.error("No matching pull request found"); | ||
} | ||
const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({owner, repo, run_id}); | ||
if (!artifacts.length) { | ||
return core.error("No build artifacts found"); | ||
} | ||
let body = "Download the build artifacts for this pull request:"; | ||
for (let artifact of artifacts) { | ||
body += `\n* [${artifact.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${artifact.id}.zip)`; | ||
} | ||
const { data: comments } = await github.rest.issues.listComments({repo, owner, issue_number}); | ||
const existing_comment = comments.find((comment) => comment.user.login === 'github-actions[bot]'); | ||
if (existing_comment) { | ||
core.info(`Updating existing comment ${existing_comment.id}`); | ||
await github.rest.issues.updateComment({repo, owner, comment_id: existing_comment.id, body}); | ||
} else { | ||
core.info("Creating a new comment"); | ||
await github.rest.issues.createComment({repo, owner, issue_number, body}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.