From b3f18b3316daa1fdc7a179bc1006072e075e1e25 Mon Sep 17 00:00:00 2001 From: Matthew Griffin Date: Fri, 28 Jun 2024 09:26:25 +0100 Subject: [PATCH] Create new workflow with first job of creating the package file --- .github/workflows/publish-package.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/publish-package.yml diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 00000000..455389e7 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,26 @@ +name: Publish new package +on: + workflow_dispatch: + pull_request: #TODO - For testing, remove before final merge +jobs: + package: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set up environment + uses: ./.github/actions/set-up-environment + - name: Create package + run: | + npm run prepare + cp README.md package.json ./dist/tech-carbon-estimator/ + cd dist/tech-carbon-estimator + npm pkg delete scripts private devDependencies files + npm pkg set main=main.js + npm pack + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + path: scottlogic-tech-carbon-estimator-*.tgz + overwrite: true #TODO - For testing, remove before final merge