2024-01-03 / v3.0.0-beta.2 #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |