Skip to content

Commit

Permalink
ci(github): Automate releases (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
vandie authored Nov 11, 2023
1 parent b99f8a7 commit 7357b1b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 27 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI Pipeline

on: ['push']

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
name: Install Dependancies
- run: npm test
name: Run tests
release-please:
runs-on: ubuntu-latest
name: Release
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: google-github-actions/release-please-action@v3
name: Release Please
id: release
with:
release-type: node
package-name: webmention-handler-mongodb
path: /
# The logic below handles the npm publication:
- uses: actions/checkout@v3
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
name: Install Dependancies
if: ${{ steps.release.outputs.release_created }}
- run: npm run build
if: ${{ steps.release.outputs.release_created }}
name: Build Release
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
27 changes: 0 additions & 27 deletions .github/workflows/release-module.yml

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "echo 'No Tests Yet'",
"build": "rollup -c rollup.config.js",
"prepublish": "npm run build"
},
Expand Down

0 comments on commit 7357b1b

Please sign in to comment.