Skip to main content
Module

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

A microframework for building JavaScript HTTP applications. Runtime-agnostic. Strongly typed.
Latest
File
name: v3.x - Publish Release (GitHub)
on: # This workflow does not need a workflow_dispatch trigger. If this workflow # fails, then re-run it. release: types: [published]
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.release.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
############################################################################## # PUBLISH TO REGISTRY ##############################################################################
publish: name: Publish to registry (https://npm.pkg.github.com) needs: [check_release_version, check_file_headers, lint_code, code_formatting] if: startsWith(github.event.release.tag_name, 'v3.')
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://npm.pkg.github.com' scope: '@drashland'
- name: Build Drash libs run: | yarn install && deno task build:libs
- name: Publish run: | cd dist yarn publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}