From 4140134c7f10731b0bef5a6240070079d2561a26 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 5 Feb 2026 15:35:50 -0500 Subject: [PATCH] fix(ci): Autopublish to npm --- .github/workflows/codeql-analysis.yml | 54 --------------------------- .github/workflows/npm-publish.yml | 22 +++++++++++ .github/workflows/release.yml | 23 ++++++++++++ 3 files changed, 45 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/npm-publish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 11a7712..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [master, ] - pull_request: - # The branches below must be a subset of the branches above - branches: [master] - schedule: - - cron: '0 2 * * 2' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v4 - # Override language selection by uncommenting this and choosing your languages (go, javascript, csharp, python, cpp, java) - with: - languages: javascript - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v4 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..6257d1d --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,22 @@ +name: Publish to NPM + +on: + push: + tags: + - "*" + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: 24 + registry-url: "https://registry.npmjs.org" + - name: Build + run: npm ci --progress=false + - name: Publish to NPM + run: npm publish --access=public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..533f74c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +on: + push: + branches: + - master + +permissions: + contents: read + +name: release-please + +# https://github.com/googleapis/release-please-action +jobs: + release-please: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.RELEASE_PLEASE_TOKEN_PUBLIC_REPOS }} + release-type: node + target-branch: ${{ github.ref_name }}