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

Commit

Permalink
Add GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Biddick committed May 4, 2021
1 parent 070ff12 commit 8dca111
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Action Name
name: Main Automated Builds

# Controls when the action will run
on:
push:
branches:
- master
tags:
- "*.*.*"

# Workflow Jobs
jobs:
# Build Job
build:
runs-on: ubuntu-latest
steps:
# Step 1 - Checkout Code
- name: Checkout Code
uses: actions/checkout@v2

# Step 2 - Extract Environment Variables
- name: Extract Environment Variables
uses: FranzDiebold/[email protected]

# Step 3 - Setup NodeJS
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://registry.npmjs.org'

# Step 4 - Extract Package Version
- name: Extract Package Version
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: packageVersion
uses: martinbeentjes/[email protected]

# Step 5 - Check Package Version
- name: Check Package Version
if: ${{ startsWith(github.ref, 'refs/tags/') && steps.packageVersion.outputs.current-version != env.CI_REF_NAME }}
run: exit 1

# Step 6 - Publish to NPM
- name: Publish to NPM
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Step 7 - Generate the Changelog
- name: Generate the Changelog
id: changelog
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

# Step 8 - Create GitHub Release
- name: Create GitHub Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.CI_REF_NAME }}
name: Version ${{ env.CI_REF_NAME }}
body: |
${{ steps.changelog.outputs.changelog }}
files: |
./LICENSE

0 comments on commit 8dca111

Please sign in to comment.