From 95c458a0d4433e89dcf5f6f5884f1b94a2424cdc Mon Sep 17 00:00:00 2001 From: sfopsbot Date: Tue, 6 Aug 2024 15:28:04 +1000 Subject: [PATCH] feat: add ability to trigger publish --- .../workflows/npm-publish-github-packages.yml | 39 +++++++++++++++++++ 1 file changed, 39 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 0000000..d0cd602 --- /dev/null +++ b/.github/workflows/npm-publish-github-packages.yml @@ -0,0 +1,39 @@ +name: Manual Package Publish + +on: + workflow_dispatch: + inputs: + branch: + description: 'Branch to publish from' + required: true + default: 'main' + +jobs: + publish-package: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: 'https://npm.pkg.github.com' + + - name: Install dependencies + run: npm ci + + - name: Build package + run: npm run build + + - name: Publish package + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GHA_TOKEN }}