Browse Source

Release.yml

pull/290/head
Jeppe Rask 3 years ago
parent
commit
548f9c8c04
3 changed files with 55 additions and 28 deletions
  1. +54
    -0
      .github/workflows/release.yml
  2. +0
    -28
      .github/workflows/webpack.yml
  3. +1
    -0
      ci/getVersion.sh

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

@ -0,0 +1,54 @@
name: NodeJS with Webpack
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::$(./ci/getVersion.sh)"
id: version
# - name: Verify version
# run: |
# ./ci/verifyVersion.sh
# Verify changelog has entry with new version
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: static.zip
asset_name: static.zip
asset_content_type: application/gzip

+ 0
- 28
.github/workflows/webpack.yml View File

@ -1,28 +0,0 @@
name: NodeJS with Webpack
on:
push:
branches: [ "master" ]
pull_request:
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

+ 1
- 0
ci/getVersion.sh View File

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

Loading…
Cancel
Save