Skip to content

Commit

Permalink
chore: add github workflows for test and release
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-hulski committed Jun 16, 2023
1 parent ae10876 commit e028d6e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [master, next]

jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: git remote set-url origin https://cerebraljs:${REPO_COOKER_GITHUB_TOKEN}@github.com/cerebral/repo-cooker
- run: git config user.email "cerebraljs@gmail.com"
- run: git config user.name "Cerebral JS"
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
repository: cerebral/repo-cooker
- run: npm run release -- --no-parallel --print-release
if: github.event_name != 'pull_request'
env:
REPO_COOKER_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

env:
REPO_COOKER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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 }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run checkdeps
- run: npm test

0 comments on commit e028d6e

Please sign in to comment.