Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,27 @@ on:

jobs:
qa:
name: Lint, Typecheck, Test and Build source files
name: Check and Build source files
runs-on: [self-hosted, Linux]
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 20
node-version-file: .nvmrc

- name: Install dependencies
run: npm ci

- name: Lint source files
run: npm run lint

- name: Run Prettier
run: npm run prettier
run: pnpm install --frozen-lockfile

- name: Check types
run: npm run typecheck
- name: Check (typecheck + test + lint + prettier)
run: pnpm run check

- name: Build package
run: npm run build
run: pnpm run build
125 changes: 102 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,119 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write

env:
# Set the "NODE_AUTH_TOKEN" environmental variable that "actions/setup-node" uses as the "_authToken"
# in the generated ".npmrc" file to authenticate to the NPM registry when publishing the package.
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_PUBLIC }}
FORCE_COLOR: '3'

jobs:
ci:
name: CI Init
# Non-release pushes: open/refresh the "πŸš€ release: X.Y.Z" PR (version bump + changelog).
create-release-pr:
name: Create Release PR
runs-on: [self-hosted, Linux]
outputs:
action: ${{ steps.init.outputs.action }}
if: "!startsWith(github.event.head_commit.message, 'πŸš€ release:')"
timeout-minutes: 30
steps:
- id: init
uses: localazy/release/init@v2
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0

prepare:
name: Prepare Release PR
needs: ci
if: needs.ci.outputs.action == 'prepare'
runs-on: [self-hosted, Linux]
steps:
- uses: localazy/release/prepare@v2
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
run_install: false

- name: Setup Node
uses: actions/setup-node@v6
with:
app-id: ${{ secrets.AUTH_APP_ID }}
app-key: ${{ secrets.AUTH_APP_KEY }}
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Generate token
id: auth
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.AUTH_APP_ID }}
private-key: ${{ secrets.AUTH_APP_KEY }}

- name: Setup GitHub CLI
uses: sersoft-gmbh/setup-gh-cli-action@v3
with:
version: stable
env:
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}

- name: Create Release PR
run: npx @localazy/workflow-scripts@latest create-release-pr
env:
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}

publish:
# Release commits (the merged "πŸš€ release:" PR): build, publish to npm, tag, GitHub Release.
publish-release:
name: Publish Release
needs: ci
if: needs.ci.outputs.action == 'publish'
runs-on: [self-hosted, Linux]
if: "startsWith(github.event.head_commit.message, 'πŸš€ release:')"
timeout-minutes: 30
steps:
- uses: localazy/release/publish@v2
- name: Checkout repository
uses: actions/checkout@v6
with:
app-id: ${{ secrets.AUTH_APP_ID }}
app-key: ${{ secrets.AUTH_APP_KEY }}
npm-publish: public
npm-token: ${{ secrets.NPM_AUTH_TOKEN_PUBLIC }}
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
run_install: false

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build package
run: pnpm run build

- name: Publish to npm
run: pnpm publish --no-git-checks --access public

- name: Generate token
id: auth
uses: actions/create-github-app-token@v3
with:
client-id: ${{ secrets.AUTH_APP_ID }}
private-key: ${{ secrets.AUTH_APP_KEY }}

- name: Setup GitHub CLI
uses: sersoft-gmbh/setup-gh-cli-action@v3
with:
version: stable
env:
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}

- name: Create and push git tag
id: git-tag
run: npx @localazy/workflow-scripts@latest create-git-tag
env:
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}

- name: Create GitHub Release
run: npx @localazy/workflow-scripts@latest create-github-release "${{ steps.git-tag.outputs.version }}"
env:
GITHUB_TOKEN: ${{ steps.auth.outputs.token }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
CHANGELOG.md
dist
pnpm-lock.yaml
Loading