From 20ec4c4e0eeb3c24585da60989d5212feacf16f5 Mon Sep 17 00:00:00 2001 From: Ava Mattie <6314286+ava-cassiopeia@users.noreply.github.com> Date: Sat, 1 Mar 2025 13:59:16 -0700 Subject: [PATCH 1/2] Add basic readme file --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f6335f7 --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# GitHub Action: Publish to NPM and GitHub + +Publishes an NPM package described via `package.json` to GitHub and NPM +simultaniously with different package names. + +## Usage + +You must have a NPM token with the ability to publish packages. It is +recommended that you store this in your repository's secrets. + +Example workflow: + +```yml +name: Publish package + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install dependencies and build + run: | + npm ci + npm run build + + - name: Publish package to GitHub and NPM + uses: ava-cassiopeia/publish-to-npm-and-github@1.0.0 + with: + npm-package-name: 'your-npm-package-name' + github-package-name: '@your-github-username/your-gh-package-name' + npm-token: ${{ secrets.NPM_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} +``` From 39364852e1f83e5ad74b2420149bb2e52815f5c3 Mon Sep 17 00:00:00 2001 From: Ava Mattie <6314286+ava-cassiopeia@users.noreply.github.com> Date: Sat, 1 Mar 2025 13:59:52 -0700 Subject: [PATCH 2/2] Add ISC license --- LICENSE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..3795bad --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,5 @@ +Copyright 2025 Ava Mattie + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.