Skip to content

Commit

Permalink
cd: publish (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel committed Aug 27, 2024
1 parent addd87d commit b1bbc68
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/cd_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 'πŸš€ CD β€” Publish'

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release-please:
runs-on: ubuntu-latest
timeout-minutes: 15
name: Release Please
steps:
- name: 🀝 Release Please
uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.PAT }}
release-type: node
package-name: lru.min
changelog-path: 'CHANGELOG.md'

- name: βž• Actions - Checkout
uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}

- name: βž• Actions - Setup Node.js
uses: actions/setup-node@v4
if: ${{ steps.release.outputs.releases_created }}
with:
check-latest: true
node-version: lts/*
registry-url: 'https://registry.npmjs.org'

- name: βž• Cache dependencies
uses: actions/cache@v4
if: ${{ steps.release.outputs.releases_created }}
with:
path: ~/.npm
key: npm-linux-${{ hashFiles('package-lock.json') }}
restore-keys: npm-linux-

- name: πŸ“¦ Installing Dependencies
if: ${{ steps.release.outputs.releases_created }}
run: npm ci

- name: πŸš€ Building lru.min
if: ${{ steps.release.outputs.releases_created }}
run: npm run build

- name: πŸ“₯ Publishing Package
if: ${{ steps.release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance

0 comments on commit b1bbc68

Please sign in to comment.