diff --git a/.github/workflows/branch-validations.yaml b/.github/workflows/branch-validations.yaml deleted file mode 100644 index c1d68848..00000000 --- a/.github/workflows/branch-validations.yaml +++ /dev/null @@ -1,108 +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@v6 - - uses: actions/setup-node@v6 - with: - registry-url: 'https://registry.npmjs.org' - node-version: 23 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - 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 audit --omit=dev - - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: 23 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - 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 - needs: - - validate - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: 23 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - 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 - needs: - - validate - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: 23 - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - 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-pr-preview.yaml b/.github/workflows/deploy-preview.yaml similarity index 96% rename from .github/workflows/publish-pr-preview.yaml rename to .github/workflows/deploy-preview.yaml index 80c932b3..9cb27cf4 100644 --- a/.github/workflows/publish-pr-preview.yaml +++ b/.github/workflows/deploy-preview.yaml @@ -1,4 +1,4 @@ -name: Publish PR preview +name: Deploy preview on: pull_request: @@ -7,7 +7,7 @@ on: - opened jobs: - preview: + deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/deploy-published-releases.yaml b/.github/workflows/deploy-published-releases.yaml deleted file mode 100644 index 07868817..00000000 --- a/.github/workflows/deploy-published-releases.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Release - -on: - release: - types: - - published - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - registry-url: 'https://registry.npmjs.org' - node-version: 23 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Cache dependencies - id: cache-dependencies - uses: actions/cache@v5 - 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: Build package - run: npm run build - - - name: Prepare release - run: |- - cp LICENSE README.md build/ - cd build - find . -type f -path '*/*\.js.map' -exec sed -i -e "s~../src~src~" {} + - sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json - sed -i -e "s~\./build~.~" package.json - sed -i -e "s~./src~.~" package.json - - - name: Publish pre-release to NPM - if: ${{ github.event.release.prerelease }} - run: |- - cd build - 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 - 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 00000000..ca90f7d4 --- /dev/null +++ b/.github/workflows/deploy-release.yaml @@ -0,0 +1,20 @@ +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 LICENSE README.md build/ && + cd build && + find . -type f -path '*/*\.js.map' -exec sed -i -e "s~../src~src~" {} + && + sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json && + sed -i -e "s~\./build~.~" package.json && + sed -i -e "s~./src~.~" package.json + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/validate-branch.yaml b/.github/workflows/validate-branch.yaml new file mode 100644 index 00000000..9c9ffff7 --- /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 03984e95..df260409 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