Skip to content

Commit

Permalink
feat(workflow): add a ci pre-commit check
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Aug 9, 2022
1 parent bcf194b commit 8eff9ca
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 48 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Pre-commit

on:
pull_request:
push:
workflow_dispatch:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
- name: Install GDScript Toolkit
run: pip3 install 'gdtoolkit==3.*'
- name: Run pre-commit hooks
uses: pre-commit/[email protected]
25 changes: 13 additions & 12 deletions .github/workflows/release-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Release Packaging

on:
push:
branches: [main]
workflow_dispatch:

env:
Expand All @@ -18,7 +19,7 @@ jobs:
image: barichello/godot-ci:3.5
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/templates
Expand All @@ -35,7 +36,7 @@ jobs:
- name: Zip Folder
run: zip -r itch.zip build/windows
- name: Deploy to itch.io
if: ${{ env.ITCH_IO==true }}
if: ${{ env.ITCH_IO == true }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
Expand All @@ -51,7 +52,7 @@ jobs:
image: barichello/godot-ci:3.5
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/templates
Expand All @@ -68,7 +69,7 @@ jobs:
- name: Zip Folder
run: zip -r itch.zip build/linux
- name: Deploy to itch.io
if: ${{ env.ITCH_IO==true }}
if: ${{ env.ITCH_IO == true }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
Expand All @@ -84,7 +85,7 @@ jobs:
image: barichello/godot-ci:3.5
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/templates
Expand All @@ -111,7 +112,7 @@ jobs:
- name: Zip Folder
run: zip -r itch.zip build/web
- name: Deploy to itch.io
if: ${{ env.ITCH_IO==true }}
if: ${{ env.ITCH_IO == true }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
Expand All @@ -127,7 +128,7 @@ jobs:
image: barichello/godot-ci:3.5
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/templates
Expand All @@ -144,7 +145,7 @@ jobs:
- name: Zip Folder
run: zip -r itch.zip build/mac
- name: Deploy to itch.io
if: ${{ env.ITCH_IO==true }}
if: ${{ env.ITCH_IO == true }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
Expand All @@ -160,7 +161,7 @@ jobs:
image: barichello/godot-ci:3.5
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/templates
Expand All @@ -173,7 +174,7 @@ jobs:
- name: Android Debug Build
run: |
mkdir -v -p build/android
godot --verbose --export-debug "Android-CI-job (Do not edit)" ./build/android/$EXPORT_NAME.debug.apk
godot -v --export-debug "Android-CI-job (Do not edit)" ./build/android/$EXPORT_NAME.debug.apk
- name: Android Release Build
if: ${{ env.RELEASE_ANDROID==true }}
env:
Expand All @@ -185,15 +186,15 @@ jobs:
sed 's@keystore/release[[:space:]]*=[[:space:]]*".*"@keystore/release = "/root/release.keystore"@g' -i export_presets.cfg
sed 's@keystore/release_password[[:space:]]*=[[:space:]]*".*"@keystore/release_password="'$K8S_SECRET_RELEASE_KEYSTORE_PASSWORD'"@g' -i export_presets.cfg
sed 's@keystore/release_user[[:space:]]*=[[:space:]]*".*"@keystore/release_user="'$K8S_SECRET_RELEASE_KEYSTORE_USER'"@g' -i export_presets.cfg
godot --verbose --export "Android" ./build/android/$EXPORT_NAME.release.apk
godot -v --export "Android" ./build/android/$EXPORT_NAME.release.apk
- uses: actions/upload-artifact@v3
with:
name: android
path: build/android
- name: Zip Folder
run: zip -r itch.zip build/android
- name: Deploy to itch.io
if: ${{ env.ITCH_IO==true }}
if: ${{ env.ITCH_IO == true }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export.cfg
.mono/
data_*/

scripts/version.gd
scripts/version.gd
15 changes: 12 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files # Prevent giant files from being committed
- id: check-byte-order-marker # Prevents weird UTF-8 encoding edge cases
- id: check-case-conflict # Check if case-insensitive filesystems would bork
- id: check-docstring-first # Check for if docstring was misplaced
- id: check-executables-have-shebangs
- id: check-json # Checks for valid json
- id: check-merge-conflict # Checks strings that look like a committed merge conflict
- id: check-xml # Checks for valid xml
- id: check-yaml # Checks for valid yaml
- id: end-of-file-fixer # Checks for ending with a newline
- id: mixed-line-ending # Consistent LF or CRLF
- id: trailing-whitespace # No trailing whitespace
- repo: local
hooks:
- id: gdlint
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"files.exclude": {
"**/*.import": true,
"**/*.import": true
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[plugin]

name="Godot Version Export"
name="Godot Version Exporter"
description=""
author="florianvazelle"
version="1.0.0"
script="exporter_version.gd"
script="version_exporter.gd"
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ func _enter_tree() -> void:
exporter = AEVExporter.new()
exporter.plugin = self
add_export_plugin(exporter)
add_tool_menu_item("Print Current Version", self, "print_version")


if not File.new().file_exists(VERSION_SCRIPT_PATH):
exporter.store_version(fetch_version())

func _exit_tree() -> void:
remove_export_plugin(exporter)
remove_tool_menu_item("Print Current Version")

class AEVExporter extends EditorExportPlugin:
var plugin

func _export_begin(_features: PoolStringArray, _is_debug: bool, _path: String, _flags: int) -> void:
var version: String = plugin.fetch_version()
store_version(version)
Expand Down
4 changes: 3 additions & 1 deletion assets/sounds/bump.wav.import
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
4 changes: 3 additions & 1 deletion assets/sounds/finish_line.wav.import
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
4 changes: 3 additions & 1 deletion assets/sounds/hit.wav.import
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
4 changes: 3 additions & 1 deletion assets/sounds/roll.wav.import
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=true
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
4 changes: 3 additions & 1 deletion assets/sounds/ui_open.wav.import
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
Loading

0 comments on commit 8eff9ca

Please sign in to comment.