Skip to content

Commit

Permalink
patch: use org bump, release, publish
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlday committed Dec 11, 2022
1 parent 87ff374 commit cf851ed
Showing 1 changed file with 7 additions and 98 deletions.
105 changes: 7 additions & 98 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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: Bump, Release, and Publish

on:
Expand All @@ -21,98 +18,10 @@ concurrency:
cancel-in-progress: true

jobs:
version-and-release:
runs-on: ubuntu-latest
steps:
- 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: lts/*
registry-url: https://registry.npmjs.org/
- name: NPM Clean Install
run: npm ci
- name: NPM Run Build
run: npm run build --if-present
- name: NPM Test
run: npm test
env:
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}}
publish:
uses: prosegrinder/.github/.github/workflows/npm-publish.yaml
with:
newversion: ${{ github.event.inputs.newversion }}
secrets:
VERSION_BUMP_TAG_TOKEN: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}

0 comments on commit cf851ed

Please sign in to comment.