-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from aaronczichon/improvements/general
General improvements to code structure
- Loading branch information
Showing
19 changed files
with
487 additions
and
523 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
name: Release Plugin | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
define-variables: | ||
name: Defining and extracting Variables | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.get_version.outputs.VERSION }} | ||
label: ${{ steps.get_label.outputs.LABEL }} | ||
pre_release: ${{ steps.prerelease_check.outputs.PRE_RELEASE }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get Version | ||
id: get_version | ||
# E.g. converts ref/tags/v0.0.1 -> 0.0.1 | ||
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 1-)" >> $GITHUB_OUTPUT | ||
- name: Get Label | ||
id: get_label | ||
# E.g. converts 0.0.1-beta.1 -> beta | ||
run: echo "LABEL=$(echo ${{ steps.get_version.outputs.VERSION }} | awk -F '-' '{split($2, arr, "."); print arr[1]}')" >> $GITHUB_OUTPUT | ||
- name: Check for Pre-Release or Release | ||
id: prerelease_check | ||
# perform secret check & put boolean result as an output | ||
run: | | ||
if [ "${{ steps.get_label.outputs.LABEL }}" != '' ]; then | ||
echo "PRE_RELEASE=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "PRE_RELEASE=false" >> $GITHUB_OUTPUT | ||
fi | ||
create-release: | ||
needs: [define-variables] | ||
name: Create Github Release | ||
if: needs.define-variables.outputs.pre_release == 'false' | ||
runs-on: ubuntu-latest | ||
env: | ||
NPM_PACKAGE_VERSION: ${{ needs.define-variables.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build Plugin | ||
run: | | ||
npm install | ||
npm run version | ||
npm run build | ||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
name: Publish Release | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
title: ${{ needs.define-variables.outputs.version }} | ||
files: | | ||
main.js | ||
manifest.json | ||
styles.css | ||
create-prerelease: | ||
needs: [define-variables] | ||
name: Create Github Pre-Release | ||
if: needs.define-variables.outputs.pre_release == 'true' | ||
runs-on: ubuntu-latest | ||
env: | ||
NPM_PACKAGE_VERSION: ${{ needs.define-variables.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build Plugin | ||
run: | | ||
npm install | ||
npm run version | ||
npm run build | ||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
name: Publish Release | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: true | ||
title: ${{ needs.define-variables.outputs.version }} | ||
files: | | ||
main.js | ||
manifest.json | ||
styles.css | ||
define-variables: | ||
name: Defining and extracting Variables | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.get_version.outputs.VERSION }} | ||
label: ${{ steps.get_label.outputs.LABEL }} | ||
pre_release: ${{ steps.prerelease_check.outputs.PRE_RELEASE }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get Version | ||
id: get_version | ||
# E.g. converts ref/tags/v0.0.1 -> 0.0.1 | ||
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3 | cut -c 1-)" >> $GITHUB_OUTPUT | ||
- name: Get Label | ||
id: get_label | ||
# E.g. converts 0.0.1-beta.1 -> beta | ||
run: echo "LABEL=$(echo ${{ steps.get_version.outputs.VERSION }} | awk -F '-' '{split($2, arr, "."); print arr[1]}')" >> $GITHUB_OUTPUT | ||
- name: Check for Pre-Release or Release | ||
id: prerelease_check | ||
# perform secret check & put boolean result as an output | ||
run: | | ||
if [ "${{ steps.get_label.outputs.LABEL }}" != '' ]; then | ||
echo "PRE_RELEASE=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "PRE_RELEASE=false" >> $GITHUB_OUTPUT | ||
fi | ||
create-release: | ||
needs: [define-variables] | ||
name: Create Github Release | ||
if: needs.define-variables.outputs.pre_release == 'false' | ||
runs-on: ubuntu-latest | ||
env: | ||
NPM_PACKAGE_VERSION: ${{ needs.define-variables.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build Plugin | ||
run: | | ||
npm install | ||
npm run version | ||
npm run build | ||
- uses: 'marvinpinto/action-automatic-releases@latest' | ||
name: Publish Release | ||
with: | ||
repo_token: '${{ secrets.GITHUB_TOKEN }}' | ||
prerelease: false | ||
title: ${{ needs.define-variables.outputs.version }} | ||
files: | | ||
main.js | ||
manifest.json | ||
styles.css | ||
create-prerelease: | ||
needs: [define-variables] | ||
name: Create Github Pre-Release | ||
if: needs.define-variables.outputs.pre_release == 'true' | ||
runs-on: ubuntu-latest | ||
env: | ||
NPM_PACKAGE_VERSION: ${{ needs.define-variables.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build Plugin | ||
run: | | ||
npm install | ||
npm run version | ||
npm run build | ||
- uses: 'marvinpinto/action-automatic-releases@latest' | ||
name: Publish Release | ||
with: | ||
repo_token: '${{ secrets.GITHUB_TOKEN }}' | ||
prerelease: true | ||
title: ${{ needs.define-variables.outputs.version }} | ||
files: | | ||
main.js | ||
manifest.json | ||
styles.css |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- feature/v2 | ||
push: | ||
branches: | ||
- main | ||
- feature/v2 | ||
|
||
jobs: | ||
build-library: | ||
name: Build Plugin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build plugin | ||
run: npm run build | ||
run-validations: | ||
name: Validate Code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Validate code format | ||
run: npm run check | ||
- name: Validate changelog | ||
uses: mindsers/[email protected] | ||
with: | ||
# Path to the CHANGELOG file containing the log entries | ||
path: ./CHANGELOG.md | ||
# Specifies if the CHANGELOG.md file should be validated and the behavior of the action | ||
validation_level: error | ||
build-library: | ||
name: Build Plugin | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build plugin | ||
run: npm run build | ||
run-validations: | ||
name: Validate Code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Validate code format | ||
run: npm run check | ||
- name: Validate changelog | ||
uses: mindsers/[email protected] | ||
with: | ||
# Path to the CHANGELOG file containing the log entries | ||
path: ./CHANGELOG.md | ||
# Specifies if the CHANGELOG.md file should be validated and the behavior of the action | ||
validation_level: error |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"useTabs": true, | ||
"tabWidth": 2, | ||
"semi": true, | ||
"endOfLine": "lf" | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@aaronczichon |
Oops, something went wrong.