Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
fix(ci): use typescript-action for ci and cd
Browse files Browse the repository at this point in the history
This is a no-code change, primarily to see the release workflow work as intended.
  • Loading branch information
EricCrosson committed Jan 10, 2023
1 parent 5a6bf2e commit bae7f45
Show file tree
Hide file tree
Showing 5 changed files with 1,588 additions and 10,771 deletions.
36 changes: 5 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
---
name: CI

on: [ pull_request ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [lts/-2, lts/-1, lts/*]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# Install npm greater-than-or-equal-to 7 so we can use npm workspaces.
# We can remove this when Node.js 16 is the oldest LTS
- name: Update npm
run: npm install --global 'npm@>7'

- run: |
npm ci
npm run build
npm test
test:
uses: EricCrosson/typescript-action/.github/workflows/ci.yml@v1
47 changes: 12 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,19 @@
---
name: Release

on:
push:
branches: [ master, alpha, beta ]

# Only allow one release workflow to execute at a time, since each release
# workflow uses shared resources (git tags, package registries)
concurrency:
group: ${{ github.workflow }}
branches:
- master
- next
- next-major
- beta
- alpha
- "[0-9]+.[0-9]+.x"
- "[0-9]+.x"

jobs:
release:
name: Release

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Install dependencies
run: npm ci

- name: Compile TypeScript
run: npm run build

- name: Test
run: npm test

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
uses: EricCrosson/typescript-action/.github/workflows/release.yml@v1
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
actionlint.enable = true;
alejandra.enable = true;
prettier.enable = true;
};
Expand Down
Loading

0 comments on commit bae7f45

Please sign in to comment.