Skip to content

Workflow file for this run

name: Build and Release
on:
push:
branches:
- master
workflow_dispatch:
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 ci --legacy-peer-deps
- name: Run build
run: npm run build
- name: Archive production artifacts
run: zip -r dist.zip dist
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: dist.zip
- name: Determine TAG_NAME
run: |
echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: Release ${{ env.TAG_NAME }}
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.zip
asset_name: dist.zip
asset_content_type: application/zip