From e3dcfbf018db6e51960943437af533af0392b058 Mon Sep 17 00:00:00 2001 From: Cara Fisher Date: Tue, 16 Apr 2024 15:49:57 +0100 Subject: [PATCH] ci: try new development/release workflows --- .github/workflows/build.yml | 44 ------------------------ .github/workflows/development.yml | 57 +++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 21 ------------ .github/workflows/npm-publish.yml | 40 ---------------------- .github/workflows/release.yml | 33 ++++++++++++++++++ .github/workflows/setup.yml | 19 ----------- .github/workflows/test.yml | 11 ------ 7 files changed, 90 insertions(+), 135 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/development.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/npm-publish.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/setup.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 75058fdc6..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build & Test - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Setup - uses: ./.github/workflows/setup.yml - - - name: Build - run: | - npm run bundle - npm run bundle-min - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-artifacts - path: ./packages/**/build - - test: - needs: build - runs-on: ubuntu-latest - - steps: - - name: Setup - uses: ./.github/workflows/setup.yml - - - name: Download build artifacts - uses: actions/download-artifact@v4 - - - name: Display structure of downloaded artifacts - run: ls -R - - - name: Test - uses: ./.github/workflows/test.yml - diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 000000000..29ee171fa --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,57 @@ +name: Development + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_call: + +jobs: + build-test: + name: Build and test + runs-on: ubuntu-latest + steps: + - name: "Checkout repository" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Setup Node" + uses: actions/setup-node@v3 + with: + node-version: latest + + - name: "Install dependencies" + run: npm ci + + - name: "Build" + run: | + npm run bundle + npm run bundle-min + + - name: "Run tests" + run: npm test + + lint: + name: Code standards + runs-on: ubuntu-latest + steps: + - name: "Checkout repository" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Setup Node" + uses: actions/setup-node@v3 + with: + node-version: latest + + - name: "Install dependencies" + run: npm ci + + - name: "Lint code" + run: npm run lint + + - name: "Lint commit" + run: npm run commitlint \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 3957b50a4..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Lint - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Setup - uses: ./.github/workflows/setup.yml - - - name: commitlint - run: npm run commitlint - - - name: lint - run: npm run lint diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml deleted file mode 100644 index 4ae893b34..000000000 --- a/.github/workflows/npm-publish.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Node.js Package - -on: - push: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: latest - - name: Build - run: | - npm ci - npm run commitlint - npm run lint - npm run bundle - npm run bundle-min - npm test - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: latest - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: npm run publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..202f3e3df --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + push: + branches: [ "master" ] + +jobs: + build-test-lint: + name: Build, test, and lint + uses: d3fc/d3fc/.github/workflows/development.yml@main + + publish-npm: + needs: build-test-lint + runs-on: ubuntu-latest + steps: + - name: "Checkout repository" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: "Setup Node" + uses: actions/setup-node@v3 + with: + node-version: latest + registry-url: https://registry.npmjs.org/ + + - name: "Install dependencies" + run: npm ci + + - name: "Publish" + run: npm run publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml deleted file mode 100644 index 5f1415430..000000000 --- a/.github/workflows/setup.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Setup - -on: workflow_call - -jobs: - setup: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: latest - - - name: Install dependencies - run: npm ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 118f612ad..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Test - -on: workflow_call - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: Test - run: npm test