Skip to content

Commit

Permalink
fix: update releaser action
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Apr 10, 2023
1 parent 34a83a6 commit 027c606
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 30 deletions.
50 changes: 20 additions & 30 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,22 @@ name: Test & Maybe Release
on: [push, pull_request]
jobs:
test:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: [14, 16, current, lts/*]
# windows support not quite ready: os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, macos-latest]

node: [16.x, 18.x, lts/*, current]
# not quite windows ready, halp! os: [macos-latest, ubuntu-latest, windows-latest]
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Clone repository
- name: Checkout Repository
uses: actions/checkout@v3

- run: git fetch --prune --unshallow

- name: Set Node.js version
uses: actions/setup-node@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}

- run: node --version
- run: npm --version
- run: git --version

- name: Install npm dependencies
run: npm install

- name: Set up ghauth config (Ubuntu)
run: |
mkdir -p ~/.config/changelog-maker/
Expand All @@ -48,31 +36,33 @@ jobs:
echo {"user": "nodejs", "token": "${{ secrets.GITHUB_TOKEN }}"} > "%LOCALAPPDATA%\changelog-maker\config.json"
shell: cmd
if: startsWith(matrix.os, 'windows')

- name: Install Dependencies
run: |
npm install --no-progress
- name: Run tests
run: npm test

run: |
npm config set script-shell bash
npm run test:ci
release:
name: Release
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v3.6.0
with:
node-version: lts/*

- name: Install dependencies
run: |
npm install --no-progress --no-package-lock --no-save
- name: Build
run: |
npm run build
- name: Install plugins
run: |
npm install \
Expand All @@ -84,9 +74,9 @@ jobs:
@semantic-release/git \
@semantic-release/changelog \
--no-progress --no-package-lock --no-save
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"scripts": {
"lint": "standard",
"unit": "tap --no-check-coverage test.js",
"build": "true",
"test:ci": "npm run test",
"test": "npm run lint && npm run unit"
},
"release": {
Expand Down

0 comments on commit 027c606

Please sign in to comment.