Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
[MINOR]: Update workflows and version to 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Swann committed Jun 30, 2021
1 parent a4bd68e commit 583f300
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Auto_Publish
name: Automate_Release
on:
workflow_run:
workflows: ["Auto_Tag"]
workflows: ["Automate_Tag"]
types:
- completed
jobs:
auto-publish:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/heads/master') && !startsWith(github.event.head_commit.message, '[RELEASE]')"
if: "github.head_ref == 'master'"
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
Expand All @@ -20,4 +20,3 @@ jobs:
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Auto_Tag
name: Automate_Tag
on: [push]
jobs:
test:
Expand All @@ -16,10 +16,13 @@ jobs:
- run: npm install
- run: npm test

auto-tag:
auto-tag-patch:
needs: test
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/heads/master') && !startsWith(github.event.head_commit.message, '[RELEASE]')"
if: |
github.head_ref == 'master' &&
!contains(github.event.head_commit.message, '[MAJOR]') &&
!contains(github.event.head_commit.message, '[MINOR]')
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
Expand All @@ -31,10 +34,13 @@ jobs:
git config --local user.name "$(git log --format='%an' HEAD^!)"
npm version patch
release-tags:
auto-tag-minor:
needs: test
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/heads/master') && startsWith(github.event.head_commit.message, '[RELEASE]')"
if: |
github.head_ref == 'master' &&
!contains(github.event.head_commit.message, '[MAJOR]') &&
contains(github.event.head_commit.message, '[MINOR]')
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
Expand All @@ -44,4 +50,22 @@ jobs:
- run: |
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"
PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag v$PACKAGE_VERSION && git push --tags
npm version minor
auto-tag-major:
needs: test
runs-on: ubuntu-latest
if: |
github.head_ref == 'master' &&
contains(github.event.head_commit.message, '[MAJOR]') &&
!contains(github.event.head_commit.message, '[MINOR]')
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: |
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"
npm version major

0 comments on commit 583f300

Please sign in to comment.