summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorCrafterPika <48294025+CrafterPika@users.noreply.github.com>2022-09-15 18:50:34 +0200
committerGitHub <noreply@github.com>2022-09-15 12:50:34 -0400
commitb879bf712f9286c690f8cac44be056e7decbaadf (patch)
treed89238d6168ed9c1fd170cee41080df6713e7d60 /.github
parent81b905ae4575332f405a9276894389eca42f737a (diff)
downloadBedrockConnect-b879bf712f9286c690f8cac44be056e7decbaadf.tar.gz
BedrockConnect-b879bf712f9286c690f8cac44be056e7decbaadf.tar.bz2
BedrockConnect-b879bf712f9286c690f8cac44be056e7decbaadf.zip
Regex Pattern Fix #3 (#337)
* attempt to fix regex detection * second try
Diffstat (limited to '.github')
-rw-r--r--.github/assets/pattern_check.py7
-rw-r--r--.github/workflows/release.yml30
2 files changed, 17 insertions, 20 deletions
diff --git a/.github/assets/pattern_check.py b/.github/assets/pattern_check.py
new file mode 100644
index 0000000..79e3099
--- /dev/null
+++ b/.github/assets/pattern_check.py
@@ -0,0 +1,7 @@
+# modules
+import re
+import sys
+
+# pattern
+pattern = re.compile(r"(?!supportedVersion.*|(S|s)upported.*)((S|s)upport.*|(R|r)elease.*|(B|b)ump version.*).*")
+print(bool(re.search(pattern, sys.argv[1]))) \ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 67c0557..9d178e0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -10,19 +10,16 @@ jobs:
steps:
- uses: actions/checkout@v3
- - name: Check for condition
- id: check
+ - name: Set Enviroment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
- if [[ "${{ github.event.head_commit.message }}" =~ ^((?!supportedVersion)(S|s)upport.*)|((R|r)elease.*|(B|b)ump version.*).* ]]; then
- echo ::set-env name=NEW_RELEASE::true
- else
- echo ::set-env name=NEW_RELEASE::false
- fi
+ echo ::set-env name=RELEASE_VERSION::$(echo $(python .github/assets/versionUp.py))
+ echo ::set-env name=MINECRAFT_VERSION::$(echo $(cat .github/assets/supportedVersion))
+ echo ::set-env name=NEW_RELEASE::$(echo $(python .github/assets/pattern_check.py "${{ github.event.head_commit.message }}"))
- name: Set up OpenJDK
- if: env.NEW_RELEASE == 'true'
+ if: env.NEW_RELEASE == 'True'
uses: actions/setup-java@v2
with:
java-version: '11'
@@ -30,20 +27,13 @@ jobs:
cache: maven
- name: Set up Python3
- if: env.NEW_RELEASE == 'true'
+ if: env.NEW_RELEASE == 'True'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- - name: set env
- if: env.NEW_RELEASE == 'true'
- env:
- ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- run: |
- echo ::set-env name=RELEASE_VERSION::$(echo $(python .github/assets/versionUp.py))
-
- name: Build with maven & make release artifacts
- if: env.NEW_RELEASE == 'true'
+ if: env.NEW_RELEASE == 'True'
run: |
cd serverlist-server
mvn -B package --file pom.xml
@@ -56,7 +46,7 @@ jobs:
rm -rf setup-zip
- name: create release
- if: env.NEW_RELEASE == 'true'
+ if: env.NEW_RELEASE == 'True'
id: create_release
uses: actions/create-release@v1
env:
@@ -68,7 +58,7 @@ jobs:
prerelease: false
- name: Upload Release Asset 1
- if: env.NEW_RELEASE == 'true'
+ if: env.NEW_RELEASE == 'True'
id: upload-release-asset1
uses: actions/upload-release-asset@v1.0.1
env:
@@ -80,7 +70,7 @@ jobs:
asset_content_type: application/zip
- name: Upload Release Asset 2
- if: env.NEW_RELEASE == 'true'
+ if: env.NEW_RELEASE == 'True'
id: upload-release-asset2
uses: actions/upload-release-asset@v1.0.1
env: