Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle authored Nov 1, 2024
0 parents commit a514eec
Show file tree
Hide file tree
Showing 52 changed files with 2,815 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = assets/**,addons/**,LICENSES/**
ignore-words-list = lod,LOD
11 changes: 11 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Variables used by the Justfile

# Godot

GODOT_VERSION=4.3-stable

# Game

GAME_NAME=Greeter
GAME_VERSION=0.1.0
GAME_ITCHIO_KEY=greeter
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Properly detect languages on Github.
*.gd linguist-language=GDScript

# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

# The above only works properly for Git 2.10+, so for older versions
# we need to manually list the binary files we don't want modified.
*.mp3 binary
*.png binary
*.hdr binary
34 changes: 34 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^plug\\.gd$"],
"matchStrings": [
"\\s+plug\\(\\s*\"(?<depName>.*)\",\\s+{\\s*\"commit\":\\s*\"(?<currentDigest>.*)\",\\s*\"renovate-branch\":\\s*\"(?<currentValue>.*)\""
],
"packageNameTemplate": "https://github.com/{{{depName}}}.git",
"versioningTemplate": "git",
"datasourceTemplate": "git-refs"
},
{
"customType": "regex",
"fileMatch": ["^plug\\.gd$"],
"matchStrings": [
"\\s+plug\\(\"(?<depName>.*?)\",\\ \\{\\s*\"tag\":\\ \"(?<currentValue>.*)\""
],
"packageNameTemplate": "https://github.com/{{{depName}}}.git",
"versioningTemplate": "git",
"datasourceTemplate": "git-tags"
},
{
"customType": "regex",
"fileMatch": ["^.env$"],
"matchStrings": ["GODOT_VERSION=(?<currentValue>.*?)\\n"],
"depNameTemplate": "godotengine/godot",
"packageNameTemplate": "https://github.com/godotengine/godot.git",
"versioningTemplate": "loose",
"extractVersionTemplate": "^(?<version>.*)$",
"datasourceTemplate": "git-tags"
}
]
}
56 changes: 56 additions & 0 deletions .github/workflows/appimage-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: AppImage Build

on:
workflow_dispatch:
# Ensure the build works on main
push:
branches: [main]
# Ensure the build works on each pull request
pull_request:
# Build and publish on release
release:
types: [published]

jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2

- name: Load dotenv
run: just ci-load-dotenv

- name: Load dotenv
run: just bump-version

# Install FUSE (https://github.com/AppImage/AppImageKit/wiki/FUSE)
- name: Install pkg2image dependencies
run: |
sudo add-apt-repository universe
sudo apt install libfuse2
# Install pkg2appimage and build the game (https://github.com/AppImageCommunity/pkg2appimage)
- name: Build AppImage
run: |
wget -c $(wget -q https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases -O - | grep "pkg2appimage-.*-x86_64.AppImage" | grep browser_download_url | head -n 1 | cut -d '"' -f 4)
chmod +x ./pkg2appimage-*.AppImage
./pkg2appimage-*.AppImage public/packaging/appimage/recipe.yml
- name: Rename the AppImage
run: mv ./out/*.AppImage ${{ env.game_name }}-${{ env.game_version }}.AppImage

- uses: actions/upload-artifact@v4
with:
name: ${{ env.game_name }}-${{ env.game_version }}.AppImage
path: ./

# Publish, on each release
- name: Publish AppImage
if: startsWith(github.ref, 'refs/tags/')
run: |
gh release upload ${{ env.game_version }} ./${{ env.game_name }}-${{ env.game_version }}.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/changelog_verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Changelog Verifier

on:
pull_request:
types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces the update of a changelog file on every pull request
verify-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dangoslen/changelog-enforcer@v3
with:
skipLabels: "autocut, skip-changelog"
20 changes: 20 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Link Checker

on:
pull_request:
types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
linkchecker:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: lychee Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "file:///github/workspace/*" --exclude-path ".github/renovate.json" --exclude-mail
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
31 changes: 31 additions & 0 deletions .github/workflows/lint_pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint PR Title

on:
pull_request_target:
types: [opened, edited, synchronize]

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
scopes: |
addons
assets
scripts
scenes
dependabot
workflows
readme
changelog
deps
requireScope: false
validateSingleCommit: true
validateSingleCommitMatchesPrTitle: true
123 changes: 123 additions & 0 deletions .github/workflows/release-packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Release Packaging

on:
push:
workflow_dispatch:

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
check:
runs-on: ubuntu-24.04
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2

- name: Load dotenv
run: just ci-load-dotenv

- name: Check
run: just fmt

- name: Ensure version is equal to tag
if: startsWith(github.ref, 'refs/tags/')
run: |
[ "${{ env.game_version }}" == "${{ env.BRANCH_NAME }}" ] || exit 2
build:
runs-on: ubuntu-24.04
timeout-minutes: 30
needs: [check]

steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2

- name: Load dotenv
run: just ci-load-dotenv

- name: Cache Godot
uses: actions/cache@v4
with:
path: |
~/.mkflower/bin
~/.local/share/godot/export_templates
key: ${{ env.godot_version }}

- name: Export
run: just export

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.game_name }}-v${{ env.game_version }}
path: dist/*
retention-days: 1

deploy:
runs-on: ubuntu-24.04
timeout-minutes: 30
needs: [check]

if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2

- name: Load dotenv
run: just ci-load-dotenv

- name: Cache Godot
uses: actions/cache@v4
with:
path: |
~/.mkflower/bin
~/.local/share/godot/export_templates
key: ${{ env.godot_version }}

- name: Export
run: just export-web

# Installing rsync is needed in order to deploy to GitHub Pages. Without it, the build will fail.
- name: Install rsync
run: |
sudo apt-get update && sudo apt-get install -y rsync
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build/web

publish:
runs-on: ubuntu-24.04
timeout-minutes: 30
needs: [build]

if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2

- name: Load dotenv
run: just ci-load-dotenv

- name: Download artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: ${{ env.game_name }}-v${{ env.game_version }}
path: dist/
skip_unpack: false

- name: Publish
run: just ci-publish
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Renovate

on:
pull_request:
paths:
- .github/renovate.json
- .github/workflows/renovate.yml

jobs:
renovate-local:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: repo
- run: |
mv repo /tmp/repo
sudo chown -R runneradmin:root /tmp/repo
- uses: renovatebot/[email protected]
with:
configurationFile: /tmp/repo/.github/renovate.json
token: ${{ secrets.RENOVATE_TOKEN }}
docker-volumes: |
/tmp/repo:/usr/src/app
env:
LOG_LEVEL: debug
RENOVATE_DRY_RUN: full
RENOVATE_PLATFORM: local
39 changes: 39 additions & 0 deletions .github/workflows/snapcraft-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Snapcraft Build

on:
workflow_dispatch:
# Ensure the build works on main
push:
branches: [main]
# Ensure the build works on each pull request
pull_request:
# Build and publish on release
release:
types: [published]

jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2

- name: Load dotenv
run: just bump-version

- name: Build snap package
uses: snapcore/action-build@v1
with:
path: public/packaging
id: snapcraft

# Push, on each release, to the stable channel
- uses: snapcore/action-publish@v1
if: startsWith(github.ref, 'refs/tags/')
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: ${{ steps.snapcraft.outputs.snap }}
release: stable
Loading

0 comments on commit a514eec

Please sign in to comment.