Skip to content

Commit

Permalink
chore: push-button releases
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlday committed Nov 20, 2022
1 parent 51232be commit cd16b30
Show file tree
Hide file tree
Showing 3 changed files with 4,112 additions and 184 deletions.
132 changes: 106 additions & 26 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,118 @@
# This workflow will run tests using node and then publish a package to npmjs.org when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: NPM Publish
name: Bump, Release, and Publish

on:
release:
types: [created]
workflow_dispatch:
inputs:
newversion:
description: "Bump Type (major minor patch)"
required: true
default: "patch"
type: choice
options:
- patch
- minor
- major

concurrency:
group: tag-and-release
cancel-in-progress: true

jobs:
publish-npm:
version-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3.5.1
- name: "Checkout source code"
uses: "actions/checkout@v3"
with:
fetch-depth: 0
token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3.5.1
with:
node-version: 14
node-version: lts/*
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm publish
- name: NPM Clean Install
run: npm ci
- name: NPM Run Build
run: npm run build --if-present
- name: NPM Test
run: npm test
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_ACCESS_TOKEN}}
# publish-gpr:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3.5.1
# with:
# node-version: 12
# registry-url: https://npm.pkg.github.com/
# - run: npm ci
# - run: npm run build --if-present
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
CI: true
- name: Bump, Release, and Publish
uses: bcomnes/npm-bump@v2
with:
git_email: david@davidlday.com
git_username: ${{ github.actor }}
newversion: ${{ github.event.inputs.newversion }}
push_version_commit: true
github_token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
npm_token: ${{secrets.NPM_ACCESS_TOKEN}}

# version-bump-and-tag:
# name: "Bump Version and Tag"
# runs-on: ubuntu-latest
# outputs:
# newTag: ${{ steps.version-bump.outputs.newTag }}
# steps:
# - name: "Checkout source code"
# uses: "actions/checkout@v3"
# with:
# ref: ${{ github.ref }}
# token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
# - name: "cat package.json"
# run: cat ./package.json
# - name: "Automated Version Bump"
# id: version-bump
# uses: "phips28/gh-action-bump-version@master"
# with:
# tag-prefix: "v"
# env:
# GITHUB_TOKEN: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
# - name: "cat package.json"
# run: cat ./package.json
# - name: "Output Step"
# env:
# NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
# run: echo "new tag $NEW_TAG"

# create-release:
# name: "Create Release"
# runs-on: ubuntu-latest
# needs: [version-bump-and-tag]
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# ref: ${{ needs.version-bump-and-tag.outputs.newTag }}
# token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
# - name: Release
# uses: ncipollo/release-action@v1
# with:
# tag: ${{ needs.version-bump-and-tag.outputs.newTag }}
# name: ${{ needs.version-bump-and-tag.outputs.newTag }}
# token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
# generate_release_notes: true

# publish-npm:
# runs-on: ubuntu-latest
# needs: [version-bump-and-tag, create-release]
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# ref: ${{ needs.version-bump-and-tag.outputs.newTag }}
# token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
# - uses: actions/setup-node@v3.5.1
# with:
# node-version: lts/*
# registry-url: https://registry.npmjs.org/
# - run: npm ci
# - run: npm run build --if-present
# - run: npm test
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.NPM_ACCESS_TOKEN}}
Loading

0 comments on commit cd16b30

Please sign in to comment.