Skip to content

Commit

Permalink
Merge branch 'main' of github.com:basketry/basketry into rc
Browse files Browse the repository at this point in the history
  • Loading branch information
skonves committed Apr 5, 2023
2 parents 25def4b + 3f30a4b commit 1a0bb83
Show file tree
Hide file tree
Showing 19 changed files with 1,390 additions and 681 deletions.
29 changes: 1 addition & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,4 @@ on:

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14, 16, 17, 18]

runs-on: ${{ matrix.os }}

steps:
- name: Set git to use LF
if: ${{ matrix.os == 'windows-latest' }}
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ hashFiles('**/package-lock.json') }}
- run: npm ci
if: steps.cache-node-modules.outputs.cache-hit != 'true'
- run: npm run build
- run: npm test
uses: basketry/workflows/.github/workflows/build.yml@main
38 changes: 25 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
name: publish

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
types:
- closed

jobs:
build:
compare:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
base_version: ${{ steps.base.outputs.version }}
current_version: ${{ steps.current.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm t
- run: if [[ "$GITHUB_REF" =~ refs/tags/v[0-9]+\.[0-9]+\.[0-9]+\-([^\.]+) ]]; then npm publish --tag ${BASH_REMATCH[1]} --access public; else npm publish --access public; fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
ref: ${{ github.event.pull_request.base.sha }}
- id: base
run: echo "version=$(jq -r .version < package.json)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v3
- id: current
run: echo "version=$(jq -r .version < package.json)" >> "$GITHUB_OUTPUT"
publish:
needs: compare
if: needs.compare.outputs.base_version != needs.compare.outputs.current_version
runs-on: ubuntu-latest
steps:
- uses: skonves/npm-publish@main
with:
token: ${{ secrets.NPM_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: version

on:
workflow_dispatch:
inputs:
newversion:
description: 'npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]'
required: true
preid:
description: 'The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver.'
required: false

jobs:
npm-version:
runs-on: ubuntu-latest
steps:
- uses: skonves/npm-version@main
with:
newversion: ${{ inputs.newversion }}
preid: ${{ inputs.preid }}
Loading

0 comments on commit 1a0bb83

Please sign in to comment.