Skip to content

Commit

Permalink
chore: Improve actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bn3t committed Oct 15, 2024
1 parent 913aa22 commit 11253b3
Show file tree
Hide file tree
Showing 5 changed files with 438 additions and 28 deletions.
54 changes: 44 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: CI Workflow

on:
push:
branches:
- main
pull_request:
types: [assigned, opened, synchronize, reopened, labeled]
name: ci
branches:
- '*'

permissions:
contents: read # to fetch code (actions/checkout)

Expand All @@ -13,13 +16,44 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [20]
node-version: [20, 22]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

- name: Run tests with coverage
run: npm run test -- --coverage

build:
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm install -g npm@10
- run: node --version
- run: npm ci
- run: npm run test
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build
45 changes: 28 additions & 17 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
name: Release Please Workflow

on:
push:
branches:
- main
name: release-please
permissions: {}

permissions:
contents: write # to create release commit (google-github-actions/release-please-action)
pull-requests: write # to create release PR (google-github-actions/release-please-action)

jobs:
release-please:
permissions:
contents: write # to create release commit (google-github-actions/release-please-action)
pull-requests: write # to create release PR (google-github-actions/release-please-action)

runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run Release Please
uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: '@bn3t/ssin'
package-name: '@bn3t/ssin-lib'
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
- run: npm install npm@latest -g
- run: npm ci
- run: npm run build

- name: Build project
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
run: npm run build

- name: Publish to npm
if: ${{ steps.release.outputs.release_created }}
run: npm publish --access public
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/
dist/
.vscode/
.vscode/

coverage/
Loading

0 comments on commit 11253b3

Please sign in to comment.