Skip to content

Commit

Permalink
Initial Tag/Release Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kjrocker committed Sep 14, 2024
1 parent 82db294 commit ce130cb
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 39 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [pull_request]
on:
pull_request:
push:
branches:
- main

jobs:
Test:
Expand Down
55 changes: 24 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
name: Release
name: Deploy to NPM

on:
push:
branches:
- main
release:
types: [created]

jobs:
Test:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18.x', '20.x', '22.x']

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test
- run: npm run build
# Release:
# runs-on: ubuntu-latest
# needs: Test
# steps:
# - uses: actions/checkout@v4
# - name: Use Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '22.x'
# cache: 'npm'
# - run: npm ci
# - run: npm run release
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Update package version
run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"editor.formatOnSave": true,
"editor.tabSize": 2,
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "epochal",
"version": "1.1.0",
"version": "1.2.0",
"description": "Convert ambiguous historical dates into precise start and end dates with ease ",
"main": "build/index.js",
"scripts": {
Expand Down Expand Up @@ -36,4 +36,4 @@
"dependencies": {
"date-fns": "^3.6.0"
}
}
}

0 comments on commit ce130cb

Please sign in to comment.