Skip to main content
Module

x/drash/.github/workflows/v3.x.publish_release_npm_dry_run.yml

A microframework for building JavaScript HTTP applications. Runtime-agnostic. Strongly typed.
Latest
File
name: v3.x - Publish Release (npm - Dry Run)
on: workflow_dispatch: inputs: tag_name: type: string
jobs:
############################################################################## # RELEASE VERSION CHECK ############################################################################## # # Sometimes we forget to update the `version` field in the `package.json` # file. It is intentional to manually update that file. As a result, we need # this workflow to check that we updated the version before releasing. # check_release_version: name: Check version in package.json
runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4 with: token: ${{ secrets.CI_USER_PAT }}
- name: Install Deno uses: denoland/setup-deno@v1
- name: Perform version check run: | deno task check:package-json-version --version ${{ github.event.inputs.tag_name }}
############################################################################## # CODE QUALITY ##############################################################################
check_file_headers: name: Check file headers needs: [check_release_version] runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4
- name: Install Deno uses: denoland/setup-deno@v1
- name: Check file headers run: | deno task check:file-headers
lint_code: name: Check for lint needs: [check_release_version] runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4
- name: Install Deno uses: denoland/setup-deno@v1
- name: Run Deno linter run: deno lint
code_formatting: name: Check code formatting needs: [check_release_version] runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4
- name: Install Deno uses: denoland/setup-deno@v1
- name: Run Deno formatter check run: deno fmt --check
############################################################################## # (DRY-RUN) PUBLISH TO REGISTRY ##############################################################################
publish: name: (dry-run) Publish to registry (https://registry.npmjs.org) needs: [check_release_version, check_file_headers, lint_code, code_formatting]

runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4 with: token: ${{ secrets.CI_USER_PAT }}
- name: Install Deno uses: denoland/setup-deno@v1
- name: Install Node (latest) uses: actions/setup-node@v3 with: registry-url: 'https://registry.npmjs.org' scope: '@drashland'
- name: Build Drash libs run: | yarn install && deno task build:libs
- name: (artifacts) Upload Drash libs uses: actions/upload-artifact@v3 with: name: ${{ github.event.inputs.tag_name }} path: dist retention-days: 1
- name: (dry-run) Publish run: | npm publish --access restricted --dry-run