From 4f1618c8c746e7f662a7daaf8479b7ff0a4b25b7 Mon Sep 17 00:00:00 2001 From: Tim X <95355852+AcefortuneRBH@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:01:14 -0400 Subject: [PATCH 1/5] Create npm-grunt.yml --- .github/workflows/npm-grunt.yml | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/npm-grunt.yml diff --git a/.github/workflows/npm-grunt.yml b/.github/workflows/npm-grunt.yml new file mode 100644 index 00000000..9c5d9e5c --- /dev/null +++ b/.github/workflows/npm-grunt.yml @@ -0,0 +1,74 @@ +name: NodeJS with Grunt + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + grunt + - name: Cache + uses: actions/cache@v4.2.3 + with: + # A list of files, directories, and wildcard patterns to cache and restore + path: + # An explicit key for restoring and saving the cache + key: + # An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case. + restore-keys: # optional + # The chunk size used to split up large files during upload, in bytes + upload-chunk-size: # optional + # An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms + enableCrossOsArchive: # optional, default is false + # Fail the workflow if cache entry is not found + fail-on-cache-miss: # optional, default is false + # Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache + lookup-only: # optional, default is false + # Run the post step to save the cache even if another step before fails + save-always: # optional, default is false + - name: Download a Build Artifact + uses: actions/download-artifact@v4.2.1 + with: + # Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. + name: # optional + # Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE + path: # optional + # A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified. + pattern: # optional + # When multiple artifacts are matched, this changes the behavior of the destination directories. If true, the downloaded artifacts will be in the same directory specified by path. If false, the downloaded artifacts will be extracted into individual named directories within the specified path. + merge-multiple: # optional, default is false + # The GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a different repository or from a different workflow run. If this is not specified, the action will attempt to download artifacts from the current repository and the current workflow run. + github-token: # optional + # The repository owner and the repository name joined together by "/". If github-token is specified, this is the repository that artifacts will be downloaded from. + repository: # optional, default is ${{ github.repository }} + # The id of the workflow run where the desired download artifact was uploaded from. If github-token is specified, this is the run that artifacts will be downloaded from. + run-id: # optional, default is ${{ github.run_id }} + - name: First interaction + uses: actions/first-interaction@v1.3.0 + with: + # Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }} + repo-token: + # Comment to post on an individual's first issue + issue-message: # optional + # Comment to post on an individual's first pull request + pr-message: # optional + From 1f8aaa0456fe1a47457b8b7e651e3d6a2163a352 Mon Sep 17 00:00:00 2001 From: Tim X <95355852+AcefortuneRBH@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:02:48 -0400 Subject: [PATCH 2/5] Update npm-grunt.yml --- .github/workflows/npm-grunt.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/npm-grunt.yml b/.github/workflows/npm-grunt.yml index 9c5d9e5c..26c3541d 100644 --- a/.github/workflows/npm-grunt.yml +++ b/.github/workflows/npm-grunt.yml @@ -1,5 +1,4 @@ name: NodeJS with Grunt - on: push: branches: [ "main" ] From e73a895cfe947280202d4cd103ec099b3e5c2f08 Mon Sep 17 00:00:00 2001 From: Tim X <95355852+AcefortuneRBH@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:05:35 -0400 Subject: [PATCH 3/5] Update and rename npm-grunt.yml to .yml --- .github/workflows/.yml | 49 ++++++++++++++++++++++ .github/workflows/npm-grunt.yml | 73 --------------------------------- 2 files changed, 49 insertions(+), 73 deletions(-) create mode 100644 .github/workflows/.yml delete mode 100644 .github/workflows/npm-grunt.yml diff --git a/.github/workflows/.yml b/.github/workflows/.yml new file mode 100644 index 00000000..7589d7bb --- /dev/null +++ b/.github/workflows/.yml @@ -0,0 +1,49 @@ +name: NodeJS with Grunt +on: + + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + grunt + - name: Cache + uses: actions/cache@v4.2.3 + with: + # A list of files, directories, and wildcard patterns to cache and restore + path: + # An explicit key for restoring and saving the cache + key: + # An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case. + restore-keys: # optional + # The chunk size used to split up large files during upload, in bytes + upload-chunk-size: # optional + # An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms + enableCrossOsArchive: # optional, default is false + # Fail the workflow if cache entry is not found + fail-on-cache-miss: # optional, default is false + # Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache + lookup-only: # optional, default is false + # Run the post step to save the cache even if another step before fails + save-always: # optional, default is false + + diff --git a/.github/workflows/npm-grunt.yml b/.github/workflows/npm-grunt.yml deleted file mode 100644 index 26c3541d..00000000 --- a/.github/workflows/npm-grunt.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: NodeJS with Grunt -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x, 20.x, 22.x] - - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Build - run: | - npm install - grunt - - name: Cache - uses: actions/cache@v4.2.3 - with: - # A list of files, directories, and wildcard patterns to cache and restore - path: - # An explicit key for restoring and saving the cache - key: - # An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case. - restore-keys: # optional - # The chunk size used to split up large files during upload, in bytes - upload-chunk-size: # optional - # An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms - enableCrossOsArchive: # optional, default is false - # Fail the workflow if cache entry is not found - fail-on-cache-miss: # optional, default is false - # Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache - lookup-only: # optional, default is false - # Run the post step to save the cache even if another step before fails - save-always: # optional, default is false - - name: Download a Build Artifact - uses: actions/download-artifact@v4.2.1 - with: - # Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. - name: # optional - # Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE - path: # optional - # A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified. - pattern: # optional - # When multiple artifacts are matched, this changes the behavior of the destination directories. If true, the downloaded artifacts will be in the same directory specified by path. If false, the downloaded artifacts will be extracted into individual named directories within the specified path. - merge-multiple: # optional, default is false - # The GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a different repository or from a different workflow run. If this is not specified, the action will attempt to download artifacts from the current repository and the current workflow run. - github-token: # optional - # The repository owner and the repository name joined together by "/". If github-token is specified, this is the repository that artifacts will be downloaded from. - repository: # optional, default is ${{ github.repository }} - # The id of the workflow run where the desired download artifact was uploaded from. If github-token is specified, this is the run that artifacts will be downloaded from. - run-id: # optional, default is ${{ github.run_id }} - - name: First interaction - uses: actions/first-interaction@v1.3.0 - with: - # Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }} - repo-token: - # Comment to post on an individual's first issue - issue-message: # optional - # Comment to post on an individual's first pull request - pr-message: # optional - From c498a9c79b5abcbf69f72ab8ea888e8a563852f6 Mon Sep 17 00:00:00 2001 From: Tim X <95355852+AcefortuneRBH@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:10:14 -0400 Subject: [PATCH 4/5] Create npm-publish-github-packages.yml --- .../workflows/npm-publish-github-packages.yml | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/npm-publish-github-packages.yml diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml new file mode 100644 index 00000000..b6d6e388 --- /dev/null +++ b/.github/workflows/npm-publish-github-packages.yml @@ -0,0 +1,65 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm test + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + + name: Upload a Build Artifact + uses: actions/upload-artifact@v4.6.2 + with: + # Artifact name + name: # optional, default is artifact + # A file, directory or wildcard pattern that describes what to upload + path: + # The desired behavior if no files are found using the provided path. +Available Options: + warn: Output a warning but do not fail the action + error: Fail the action with an error message + ignore: Do not output any warnings or errors, the action does not fail + + if-no-files-found: # optional, default is warn + # Duration after which artifact will expire in days. 0 means using default retention. +Minimum 1 day. Maximum 90 days unless changed from the repository settings page. + + retention-days: # optional + # The level of compression for Zlib to be applied to the artifact archive. The value can range from 0 to 9: - 0: No compression - 1: Best speed - 6: Default compression (same as GNU Gzip) - 9: Best compression Higher levels will result in better compression, but will take longer to complete. For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. + + compression-level: # optional, default is 6 + # If true, an artifact with a matching name will be deleted before a new one is uploaded. If false, the action will fail if an artifact for the given name already exists. Does not fail if the artifact does not exist. + + overwrite: # optional, default is false + # If true, hidden files will be included in the artifact. If false, hidden files will be excluded from the artifact. + + include-hidden-files: # optional, default is false + From f203f746a532011fb020ba80292ff8b10e9e5651 Mon Sep 17 00:00:00 2001 From: Tim X <95355852+AcefortuneRBH@users.noreply.github.com> Date: Wed, 16 Apr 2025 04:00:43 -0400 Subject: [PATCH 5/5] Update release.yml --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e77e76f2..8288be68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -306,3 +306,9 @@ jobs: comment-id: ${{ steps.found-comment.outputs.comment-id }} body: ${{ steps.comment-text.outputs.result }} edit-mode: 'replace' + - name: First interaction + + # Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }} repo-token: + # Comment to post on an individual's first issue-message: # optional + # Comment to post on an individual's first pull requespr-message: # optional +