create tags #3
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
name: Build and Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: 'Automated Version Bump' | |
uses: 'phips28/gh-action-bump-version@master' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
minor-wording: 'add,Adds,new' | |
major-wording: 'MAJOR,cut-major' | |
patch-wording: 'patch,fixes' | |
rc-wording: 'RELEASE,alpha' | |
default: 'patch' | |
- name: Install dependencies | |
run: npm install | |
- name: Run build | |
run: npm run build | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
- name: Extract tag name | |
id: get_tag | |
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})" | |
env: | |
GITHUB_REF: ${{ github.ref }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_tag.outputs.tag }} | |
release_name: Release ${{ steps.get_tag.outputs.tag }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./dist | |
asset_name: dist.zip | |
asset_content_type: application/zip |