diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index c334c6aca..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Build - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js latest - 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 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/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..59ef97272 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +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: + name: Publish npm package(s) + 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