diff --git a/.github/workflows/branch-validations.yaml b/.github/workflows/branch-validations.yaml deleted file mode 100644 index 96148d7..0000000 --- a/.github/workflows/branch-validations.yaml +++ /dev/null @@ -1,103 +0,0 @@ -name: Validations - -on: - push: - tags-ignore: - - '**' - branches: - - master - pull_request: - types: - - synchronize - - opened - -jobs: - security-checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Check dependency vulnerabilities - run: |- - npm i -g npm-audit-resolver@3.0.0-7 - npx check-audit --omit dev - - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Check compilation errors - run: npm run validate - - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Check coding standard violations - run: npm run lint - - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: npm ci - - - name: Run tests - run: npm run test diff --git a/.github/workflows/publish-package-preview.yaml b/.github/workflows/deploy-preview.yaml similarity index 97% rename from .github/workflows/publish-package-preview.yaml rename to .github/workflows/deploy-preview.yaml index a4cfd8c..cd0e3e2 100644 --- a/.github/workflows/publish-package-preview.yaml +++ b/.github/workflows/deploy-preview.yaml @@ -1,4 +1,4 @@ -name: Publish package preview +name: Deploy preview on: pull_request: diff --git a/.github/workflows/deploy-published-releases.yaml b/.github/workflows/deploy-published-releases.yaml deleted file mode 100644 index c3a3efc..0000000 --- a/.github/workflows/deploy-published-releases.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: Release deploy - -on: - release: - types: - - published - -jobs: - deploy-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - env: - NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }} - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-lock.json') }} - - - name: Install dependencies - if: steps.cache-dependencies.outputs.cache-hit != 'true' - run: |- - npm ci - rm -rf ~/.npmrc - - - name: Build package - run: |- - npm run build - - - name: Prepare release - run: |- - cp package.json README.md build/ - cd build - sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json - - - name: Publish pre-release to NPM - if: ${{ github.event.release.prerelease }} - run: |- - cd build - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc - npm publish --access public --tag next - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Publish release to NPM - if: ${{ !github.event.release.prerelease }} - run: |- - cd build - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc - npm publish --access public - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/deploy-release.yaml b/.github/workflows/deploy-release.yaml new file mode 100644 index 0000000..46c453e --- /dev/null +++ b/.github/workflows/deploy-release.yaml @@ -0,0 +1,18 @@ +name: Deploy release + +on: + release: + types: + - published + +jobs: + deploy: + uses: croct-tech/shared-public-configs/.github/workflows/publish-public-npm-package.yml@master + with: + prepare-script: >- + cp package.json README.md build/ && + cd build && + sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json + secrets: + NPM_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }} + PUBLISH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/draft-release.yaml similarity index 87% rename from .github/workflows/release-drafter.yaml rename to .github/workflows/draft-release.yaml index e9103f5..91e131d 100644 --- a/.github/workflows/release-drafter.yaml +++ b/.github/workflows/draft-release.yaml @@ -1,4 +1,4 @@ -name: Release Drafter +name: Draft release on: push: @@ -8,7 +8,7 @@ on: - '**' jobs: - release-draft: + draft: runs-on: ubuntu-latest steps: - name: Update release draft diff --git a/.github/workflows/send-guidelines.yaml b/.github/workflows/notify-guidelines.yaml similarity index 96% rename from .github/workflows/send-guidelines.yaml rename to .github/workflows/notify-guidelines.yaml index 919c5f6..67187fb 100644 --- a/.github/workflows/send-guidelines.yaml +++ b/.github/workflows/notify-guidelines.yaml @@ -1,11 +1,11 @@ -name: Guidelines +name: Notify guidelines on: pull_request: types: - opened jobs: - send-guidelines: + notify: runs-on: ubuntu-latest steps: - uses: wow-actions/auto-comment@v1 diff --git a/.github/workflows/update-release-notes.yaml b/.github/workflows/sync-release-notes.yaml similarity index 88% rename from .github/workflows/update-release-notes.yaml rename to .github/workflows/sync-release-notes.yaml index 0bc9171..1d5937a 100644 --- a/.github/workflows/update-release-notes.yaml +++ b/.github/workflows/sync-release-notes.yaml @@ -1,4 +1,4 @@ -name: Release notes +name: Sync release notes on: push: @@ -8,7 +8,7 @@ on: - '**' jobs: - update-notes: + sync: runs-on: ubuntu-latest steps: - name: Update release draft diff --git a/.github/workflows/validate-branch.yaml b/.github/workflows/validate-branch.yaml new file mode 100644 index 0000000..9c9ffff --- /dev/null +++ b/.github/workflows/validate-branch.yaml @@ -0,0 +1,18 @@ +name: Validate branch + +on: + push: + tags-ignore: + - '**' + branches: + - master + pull_request: + types: + - synchronize + - opened + +jobs: + validate: + uses: croct-tech/shared-public-configs/.github/workflows/javascript-validations.yml@master + with: + use-private-registry: false diff --git a/.github/workflows/check-required-labels.yaml b/.github/workflows/validate-labels.yaml similarity index 84% rename from .github/workflows/check-required-labels.yaml rename to .github/workflows/validate-labels.yaml index 03984e9..df26040 100644 --- a/.github/workflows/check-required-labels.yaml +++ b/.github/workflows/validate-labels.yaml @@ -1,4 +1,4 @@ -name: Label requirements +name: Validate labels on: pull_request: types: @@ -9,8 +9,7 @@ on: - unlabeled jobs: - check-labels: - name: Check labels + validate: runs-on: ubuntu-latest steps: - uses: docker://agilepathway/pull-request-label-checker:latest