mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-07-06 19:51:27 +00:00
Add input validation to release action
This commit is contained in:
parent
ffc31a8449
commit
e17fb666a5
2 changed files with 10 additions and 4 deletions
12
.github/workflows/release.yaml
vendored
12
.github/workflows/release.yaml
vendored
|
|
@ -4,7 +4,7 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: 'Version of Release'
|
description: 'Version of Release (format: X.X.X)'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
@ -12,6 +12,10 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Verify Input
|
||||||
|
run: |
|
||||||
|
[[ "${{ github.event.inputs.version }}" =~ ^[0-9]\.[0-9]\.[0-9]$ ]] && echo "Matches" && exit 0 || echo "Use versions like '1.2.3'" && exit 1
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -38,11 +42,13 @@ jobs:
|
||||||
uses: montudor/action-zip@v1
|
uses: montudor/action-zip@v1
|
||||||
|
|
||||||
- name: Zip Files
|
- name: Zip Files
|
||||||
run: zip -r DribbblishDynamic_${{ github.event.inputs.version }}.zip *
|
run: zip -r DribbblishDynamic_v${{ github.event.inputs.version }}.zip *
|
||||||
working-directory: dist
|
working-directory: dist
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
|
name: v${{ github.event.inputs.version }}
|
||||||
tag_name: ${{ github.event.inputs.version }}
|
tag_name: ${{ github.event.inputs.version }}
|
||||||
files: dist/DribbblishDynamic_${{ github.event.inputs.version }}.zip
|
files: dist/DribbblishDynamic_v${{ github.event.inputs.version }}.zip
|
||||||
|
fail_on_unmatched_files : true
|
||||||
|
|
@ -43,7 +43,7 @@ module.exports = {
|
||||||
cleanAfterEveryBuildPatterns: ["*.LICENSE.txt"]
|
cleanAfterEveryBuildPatterns: ["*.LICENSE.txt"]
|
||||||
}),
|
}),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
"process.env.DRIBBBLISH_VERSION": JSON.stringify((process.env.DRIBBBLISH_VERSION || "vDev").substring(1)) // Substring because the script expects the version to be `X.X.X` and not `vX.X.X`
|
"process.env.DRIBBBLISH_VERSION": JSON.stringify(process.env.DRIBBBLISH_VERSION || "Dev")
|
||||||
}),
|
}),
|
||||||
new CopyPlugin({
|
new CopyPlugin({
|
||||||
patterns: [{ from: "src/assets", to: "assets" }, { from: "src/color.ini" }]
|
patterns: [{ from: "src/assets", to: "assets" }, { from: "src/color.ini" }]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue