diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 12b446ef57..37c6a8bdb0 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@master + uses: actions/checkout@v4 - uses: "./.github/actions/install-and-build" - name: Archive Production Artifact - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: build path: build @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Install Dependencies run: npm ci --force - name: Test @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Install Dependencies run: npm ci --force - name: Lint @@ -52,7 +52,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Install Dependencies run: npm ci --force - name: Prettier @@ -62,7 +62,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Install Dependencies run: npm ci --force - name: Prettier diff --git a/.github/workflows/demos.yml b/.github/workflows/demos.yml index 4531402557..3f24825c2a 100644 --- a/.github/workflows/demos.yml +++ b/.github/workflows/demos.yml @@ -12,7 +12,7 @@ jobs: name: Demos runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - uses: "./.github/actions/install-and-build" - name: Run Demos run: npm run run-ts -- ./demo/1-basic.ts diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 3a07927b0b..d0f01678cd 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Install Dependencies run: npm ci --force - name: Build 🔧 @@ -19,7 +19,7 @@ jobs: echo "docx.js.org" > docs/.nojekyll echo "docx.js.org" > docs/CNAME - name: Archive Production Artifact - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: docs path: docs @@ -28,16 +28,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo 🛎️ - uses: actions/checkout@master + uses: actions/checkout@v4 - name: Install Dependencies run: npm ci --force - name: Download Artifact - uses: actions/download-artifact@master + uses: actions/download-artifact@v4 with: name: docs path: docs - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.5 + uses: JamesIves/github-pages-deploy-action@v4.1.5 with: branch: gh-pages folder: docs diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000000..0f48e8385d --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,46 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20.x" + - run: npm ci + - run: npm run cspell + - run: npm run prettier + - run: npm run lint + - run: npm run test:ci + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20.x" + - run: npm ci + - run: npm run build + + publish-npm: + needs: [test, build] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20.x" + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}