This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Josh Biddick
committed
May 4, 2021
1 parent
070ff12
commit 8dca111
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |