Skip to content

Commit

Permalink
ci(default): switch from semantic-release to release-please (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephigenia authored Jan 2, 2025
1 parent 6156524 commit 270553f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 334 deletions.
2 changes: 0 additions & 2 deletions .depcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ ignores:
- "@commitlint/config-conventional"
# types usually are not required directly
- "@types/jest"
# used to cleanup before build
- "rimraf"
14 changes: 5 additions & 9 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ runs:
using: "composite"
steps:
- name: setup nodejs
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
check-latest: true
check-latest: false
cache: npm
- name: cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: node-modules-${{ runner.name }}-${{ runner.arch}}-${{ hashFiles('package-lock.json') }}
- name: install dependencies
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline --no-fund
# only run npm ci when restoring the cache didn’t work to save some time
# as npm ci would remove the node_modules again
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
- run: npm ls --depth 0 || true
shell: bash
28 changes: 21 additions & 7 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
pull_request:

jobs:
# https://github.com/github/super-linter
lint:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -38,8 +37,9 @@ jobs:

test:
runs-on: ubuntu-latest
needs: [lint, build]

needs:
- lint
- build
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
Expand All @@ -64,13 +64,27 @@ jobs:
# to the secrets used
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
needs: [test]
needs:
- test
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
target-branch: ${{ github.ref_name }}
release-type: node

publish:
if: ${{ needs.release.outputs.release_created }}
runs-on: ubuntu-latest
needs:
- release
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: npx run [email protected]
- run: npm publish --dry-run --provenance --access public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit 270553f

Please sign in to comment.