Skip to content

Commit

Permalink
ci(github): Switch to Google's Release Please Action (#22)
Browse files Browse the repository at this point in the history
* ci(github): Switch to Google's Release Please Action

* ci(github): Don't run release if tests fail
  • Loading branch information
vandie committed Nov 11, 2023
1 parent 5782c50 commit fc8d9c2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 53 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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
# 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
name: Build Release
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit fc8d9c2

Please sign in to comment.