Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update releaser action #136

Merged
merged 1 commit into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/setup-node@v3.6.0
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