From e883649a82feb4b9e163ed6e818aa31230c28757 Mon Sep 17 00:00:00 2001 From: "Daniel W. Hieber" Date: Tue, 8 Oct 2024 16:08:14 -0500 Subject: [PATCH] DEV: Add release workflow (#16) closes #16 --- .github/CONTRIBUTING.md | 7 +++++++ .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/workflows/release.yml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..78d7fb3 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing + +## Release Workflow + +1. Update the version number locally then push the tag to GitHub. +2. Create a release on GitHub. +3. A GitHub Action automatically publishes the release to npm. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bbdbb1e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + steps: + + - name: Check out repo + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: latest + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f95d8d4..c35c1ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: test +name: Test on: push: