From 2ebde0576706e87218653020db59c8677825a0ef Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Fri, 27 Oct 2023 20:53:03 +0100 Subject: [PATCH] chore: add semantic release --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ package.json | 8 ++++++++ 2 files changed, 30 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d99341b7..ca80a94b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,3 +70,25 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: . + + release: + if: ${{ github.ref == 'refs/heads/main' }} + needs: [ test, spec ] + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + issues: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 20.x + - run: npm ci + - run: npm run build + - name: Release + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} + run: npx semantic-release@22 --dry-run diff --git a/package.json b/package.json index 28964032..e414f180 100644 --- a/package.json +++ b/package.json @@ -94,5 +94,13 @@ "statements": 100 } } + }, + "release": { + "branches": [ + "main" + ] + }, + "publishConfig": { + "access": "public" } }