-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
1 parent
5c15f21
commit 838b7aa
Showing
2 changed files
with
65 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,64 @@ | ||
name: Tag, Release, & Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout updated source code | ||
- uses: actions/checkout@v2 | ||
|
||
# If the version has changed, create a new git tag for it. | ||
- name: Tag | ||
id: autotagger | ||
uses: butlerlogic/action-autotag@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# The remaining steps all depend on whether or not | ||
# a new tag was created. There is no need to release/publish | ||
# updates until the code base is in a releaseable state. | ||
|
||
# If the new version/tag is a pre-release (i.e. 1.0.0-beta.1), create | ||
# an environment variable indicating it is a prerelease. | ||
- name: Pre-release | ||
if: steps.autotagger.outputs.tagname != '' | ||
run: | | ||
if [[ "${{ steps.autotagger.output.version }}" == *"-"* ]]; then echo "::set-env IS_PRERELEASE=true";else echo "::set-env IS_PRERELEASE=''";fi | ||
# Create a github release | ||
# This will create a snapshot of the module, | ||
# available in the "Releases" section on Github. | ||
- name: Release | ||
id: create_release | ||
if: steps.autotagger.outputs.tagname != '' | ||
uses: actions/create-release@v1.0.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.autotagger.outputs.tagname }} | ||
release_name: ${{ steps.autotagger.outputs.tagname }} | ||
body: ${{ steps.autotagger.outputs.tagmessage }} | ||
draft: false | ||
prerelease: env.IS_PRERELEASE != '' | ||
|
||
# Use this action to publish a single module to npm. | ||
- name: Publish | ||
id: publish_npm | ||
if: steps.autotagger.outputs.tagname != '' | ||
uses: author/action-publish@master | ||
env: | ||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} | ||
|
||
- name: Rollback Release | ||
if: failure() && steps.create_release.outputs.id != '' | ||
uses: author/action-rollback@stable | ||
with: | ||
tag: ${{ steps.autotagger.outputs.tagname }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules | |
.* | ||
!.gitignore | ||
!.npmignore | ||
!.github |