Skip to content

Commit

Permalink
Merge branch 'develop' into pr/6468
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 committed Dec 9, 2024
2 parents ff322cc + 56da181 commit 83ad5be
Show file tree
Hide file tree
Showing 267 changed files with 8,628 additions and 5,706 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/deploy-faf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

name: Deploy to FAF

# Prevent simultaneous deployments across all deployment branches as
# Prevent simultaneous deployments across all deployment branches as
# the server is unable to process multiple deployments at the same time.

concurrency:
Expand All @@ -43,8 +43,9 @@ jobs:
- name: Checkout FA repository
uses: actions/checkout@v4
with:
repository: FAForever/fa
ref: master
ssh-key: ${{ secrets.SSH_FAFOREVER_MACHINE_USER }}
repository: FAForever/fa
ref: master

# Allows us to better understand the game version and the specific commit hash when we receive a log
- name: Update version references
Expand All @@ -71,16 +72,14 @@ jobs:
- name: Create a commit
run: |
# Configure git
git config user.email "administrator@faforever.com"
git config user.name "FAForever"
git config user.email "github@faforever.com"
git config user.name "FAForever Machine User"
git add .
git commit -m "Post-process deployment"
# Update the deploy/faf branch, we force push here because
# Update the deploy/faf branch, we force push here because
# we're not interested in fixing conflicts
- name: Update deploy/faf
run: |
git push origin HEAD:deploy/faf --force
19 changes: 9 additions & 10 deletions .github/workflows/deploy-fafbeta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

name: Deploy to FAF Beta Balance

# Prevent simultaneous deployments across all deployment branches as
# Prevent simultaneous deployments across all deployment branches as
# the server is unable to process multiple deployments at the same time.

concurrency:
Expand All @@ -30,7 +30,7 @@ concurrency:
on:
workflow_dispatch:
schedule:
- cron: '0 21 1 * *'
- cron: "0 21 1 * *"

jobs:
test:
Expand All @@ -44,8 +44,9 @@ jobs:
- name: Checkout FA repository
uses: actions/checkout@v4
with:
repository: FAForever/fa
ref: develop
ssh-key: ${{ secrets.SSH_FAFOREVER_MACHINE_USER }}
repository: FAForever/fa
ref: develop

# Allows us to better understand the game version and the specific commit hash when we receive a log
- name: Update version references
Expand All @@ -58,7 +59,7 @@ jobs:
cat lua/version.lua
# Disable debugging statements
#
#
# You can overwrite these adjustments by setting up a `Debug` folder
- name: Overwrite debug references
run: |
Expand All @@ -71,16 +72,14 @@ jobs:
- name: Create a commit
run: |
# Configure git
git config user.email "administrator@faforever.com"
git config user.name "FAForever"
git config user.email "github@faforever.com"
git config user.name "FAForever Machine User"
git add .
git commit -m "Post-process deployment"
# Update the deploy/fafbeta branch, we force push here because
# Update the deploy/fafbeta branch, we force push here because
# we're not interested in fixing conflicts
- name: Update deploy/fafbeta
run: |
git push origin HEAD:deploy/fafbeta --force
19 changes: 9 additions & 10 deletions .github/workflows/deploy-fafdevelop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

name: Deploy to FAF Develop

# Prevent simultaneous deployments across all deployment branches as
# Prevent simultaneous deployments across all deployment branches as
# the server is unable to process multiple deployments at the same time.

concurrency:
Expand All @@ -30,7 +30,7 @@ concurrency:
on:
workflow_dispatch:
schedule:
- cron: '0 21 * * 4'
- cron: "0 21 * * 4"

jobs:
test:
Expand All @@ -44,8 +44,9 @@ jobs:
- name: Checkout FA repository
uses: actions/checkout@v4
with:
repository: FAForever/fa
ref: develop
ssh-key: ${{ secrets.SSH_FAFOREVER_MACHINE_USER }}
repository: FAForever/fa
ref: develop

# Allows us to better understand the game version and the specific commit hash when we receive a log
- name: Update version references
Expand All @@ -58,7 +59,7 @@ jobs:
cat lua/version.lua
# Disable debugging statements
#
#
# You can overwrite these adjustments by setting up a `Debug` folder
- name: Overwrite debug references
run: |
Expand All @@ -71,16 +72,14 @@ jobs:
- name: Create a commit
run: |
# Configure git
git config user.email "administrator@faforever.com"
git config user.name "FAForever"
git config user.email "github@faforever.com"
git config user.name "FAForever Machine User"
git add .
git commit -m "Post-process deployment"
# Update the deploy/fafdevelop branch, we force push here because
# Update the deploy/fafdevelop branch, we force push here because
# we're not interested in fixing conflicts
- name: Update deploy/fafdevelop
run: |
git push origin HEAD:deploy/fafdevelop --force
6 changes: 3 additions & 3 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ jobs:
with:
sparse-checkout: |
docs
.github/workflows/scripts
.github/workflows/scripts/bash
# Set environment path for scripts so we can access it later
- name: Update environment path
run: |
echo "${{ github.workspace }}/.github/workflows/scripts" >> $GITHUB_PATH
echo "${{ github.workspace }}/.github/workflows/scripts/bash" >> $GITHUB_PATH
# Retrieve the generated changelogs
- name: Download artifact changelog of FAF Develop
Expand All @@ -90,7 +90,7 @@ jobs:
run: |
cat generated/fafdevelop.md >> changelog/fafdevelop.md
cat generated/fafbeta.md >> changelog/fafbeta.md
# Update the posts directory contents
- name: Update changelog posts directory
shell: bash
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docs-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ on:

jobs:

# By verifying the snippets we ensure that they're compatible with the bundling
# By verifying the snippets we ensure that they're compatible with the bundling
# process. In the future we can also add spell checking and/or checks for foul words.

verify:
name: Verify snippets
runs-on: ubuntu-latest
steps:

# We check out the scripts separate because the branch that we use to
# We check out the scripts separate because the branch that we use to
# generate the changelog may not contain the scripts that we want to work with.
- name: Checkout scripts
uses: actions/checkout@v4
with:
path: scripts
sparse-checkout: |
.github/workflows/scripts
.github/workflows/scripts/bash
- name: Checkout snippets
uses: actions/checkout@v4
Expand All @@ -76,30 +76,30 @@ jobs:
- name: Update environment path
run: |
ls
echo "${{ github.workspace }}/scripts/.github/workflows/scripts" >> $GITHUB_PATH
echo "${{ github.workspace }}/scripts/.github/workflows/scripts/bash" >> $GITHUB_PATH
- name: Verify the changelog snippets
working-directory: fa/changelog/snippets # script assumes it is in this directory
run: |
changelog-verify.sh
# During the bundling process we combine the templates, the sections and the snippets
# into a single changelog.
# into a single changelog.

bundle:
name: Bundle snippets
runs-on: ubuntu-latest
needs: [verify]
steps:

# We check out the scripts separate because the branch that we use to
# We check out the scripts separate because the branch that we use to
# generate the changelog may not contain the scripts that we want to work with.
- name: Checkout scripts
uses: actions/checkout@v4
with:
path: scripts
sparse-checkout: |
.github/workflows/scripts
.github/workflows/scripts/bash
- name: Checkout snippets
uses: actions/checkout@v4
Expand All @@ -111,7 +111,7 @@ jobs:
- name: Update environment path
run: |
echo "${{ github.workspace }}/scripts/.github/workflows/scripts" >> $GITHUB_PATH
echo "${{ github.workspace }}/scripts/.github/workflows/scripts/bash" >> $GITHUB_PATH
# We need to do this to remove `deploy/` from the reference. Specifically the `/` is problematic
- name: Update reference
Expand Down
107 changes: 107 additions & 0 deletions .github/workflows/docs-convert-changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Copyright (c) 2024 Daniel 'Zjonn' Dubiel
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

name: Convert Markdown changelog to Lua

on:
workflow_dispatch:
inputs:
reference:
required: true
type: choice
description: The reference (branch or tag) to use to compile the changelog snippets from
options:
- develop
- deploy/fafbeta
- deploy/fafdevelop

workflow_call:
inputs:
reference:
required: true
type: string
description: The reference (branch or tag) to use to compile the changelog snippets from

jobs:
convert_changelog:
name: Convert changelog
runs-on: ubuntu-latest
steps:
- name: Set environment variable
run: |
echo "SCRIPTS=.github/workflows/scripts/python" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
${{ env.SCRIPTS }}
changelog
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r $SCRIPTS/requirements.txt
- name: Convert changelog to Lua
run: |
out_dir=lua_changelog
mkdir $out_dir
for file in changelog/*.md; do
out_file=$(basename ${file%.md}.lua)
python3 $SCRIPTS/changelog_markdown2lua.py "${file}" "${out_dir}/${out_file}"
done
- name: Add the Lua changelog as an artifact
uses: actions/upload-artifact@v4
with:
name: lua_changelog
path: |
lua_changelog
validate_lua_changelog:
name: Validate Lua changelog
runs-on: ubuntu-latest
container: faforever/lua:v5.0-1
needs: convert_changelog
steps:
- name: Install tooling
run: |
apk add bash git findutils
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
tests/run-syntax-test.sh
- name: Download the Lua changelog artifact
uses: actions/download-artifact@v4
with:
name: lua_changelog

- name: Validate changelog files
run: |
./tests/run-syntax-test.sh
2 changes: 1 addition & 1 deletion .github/workflows/docs-url-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:

# URLs are excluded because not all type of URLs are supported, see also:
# - https://github.com/urlstechie/urlchecker-action/issues/105
exclude_urls: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf,https://github.com/FAForever/fa/deployments
exclude_urls: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf,https://github.com/FAForever/fa/deployments,https://github.com/FAForever/fa/deployments/production
31 changes: 31 additions & 0 deletions .github/workflows/scripts/python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Setting Up Python Environment

This directory contains Python scripts that require specific dependencies to be installed. Follow the instructions below to set up the environment and run the scripts.

## Prerequisites

- At least Python 3.8
- pip (Python's package installer)
- python3-venv (Linux only)


## Setting Up the Environment

```bash
# Create a Virtual Environment
python3 -m venv .venv

# Activate the Virtual Environment
# On Windows
.\.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activate

# Install Dependencies
pip install -r requirements.txt

# Run the script
python script_name.py

# Deactivate the Virtual Environment
deactivate
Loading

0 comments on commit 83ad5be

Please sign in to comment.