Browse Source

Merge pull request #290 from jepperaskdk/master

pull/291/head
Aigars Silkalns 3 years ago
committed by GitHub
parent
commit
c80fc17fca
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 1 deletions
  1. +46
    -0
      .github/workflows/release.yml
  2. +1
    -0
      ci/getVersion.sh
  3. +9
    -0
      ci/verifyVersion.sh
  4. +1
    -1
      package.json

+ 46
- 0
.github/workflows/release.yml View File

@ -0,0 +1,46 @@
name: NodeJS with Webpack
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Build
run: |
npm install
npm run build
zip -r -j static.zip dist/*
- name: Get version
run: echo "::set-output name=version::v$(./ci/getVersion.sh)"
id: version
- name: Verify version
run: |
./ci/verifyVersion.sh ${{ steps.version.outputs.version }}
# Verify changelog has entry with new version
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
files: static.zip
fail_on_unmatched_files: true
prerelease: false
draft: false

+ 1
- 0
ci/getVersion.sh View File

@ -0,0 +1 @@
echo $(sed 's/.*"version": "\(.*\)".*/\1/;t;d' ./package.json)

+ 9
- 0
ci/verifyVersion.sh View File

@ -0,0 +1,9 @@
VERSION=$1
TAG_EXISTS=$(git ls-remote --tags origin $VERSION | wc -l)
if [ $TAG_EXISTS -eq "1" ]; then
echo "The tag '$VERSION' already exists. Please update version in package.json.";
exit 1;
fi
echo "The tag '$VERSION' does not exist - success.";

+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{
"name": "adminator",
"version": "2.0.0",
"version": "2.0.1",
"private": true,
"description": "HTML Admin Template",
"scripts": {


Loading…
Cancel
Save