Skip to content

Commit

Permalink
Backport github action updates & update translations.tsutproj to new …
Browse files Browse the repository at this point in the history
…schema
  • Loading branch information
safalin1 committed Dec 31, 2023
1 parent 387fa28 commit e3799ac
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 55 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
name: "Build Validation"

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ dev, master ]
paths: [ 'src/scripting/**' ]
pull_request:
branches: [ dev, master ]
paths: [ 'src/scripting/**' ]
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down Expand Up @@ -37,7 +39,7 @@ jobs:
- name: Setup SourceMod compiler (${{ matrix.smver }})
uses: rumblefrog/setup-sp@master
with:
version: ${{ matrix.smver }}
version: ${{ matrix.smver }}

- name: Copy includes
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
runs-on: 'ubuntu-latest'

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Set environment variables
Expand All @@ -26,7 +25,7 @@ jobs:
- name: Setup SourceMod compiler (1.11.x)
uses: rumblefrog/setup-sp@master
with:
version: 1.11.x
version: 1.11.x

- name: Copy includes
run: |
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Translations"

on:
push:
branches: [ dev, master ]
paths: [ 'src/translations/**' ]
pull_request:
paths: [ 'src/translations/**' ]
workflow_dispatch:

permissions:
contents: write

jobs:
export:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set environment variables
run: echo SCRIPTS_PATH=$(pwd) >> $GITHUB_ENV

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'

- name: Install Tsukuru CLI
run: dotnet tool install -g tsukuru

- name: Validate translation project
run: tsukuru validate-translation -f translations.tsutproj
working-directory: src/translations

- name: Export SM translations
run: tsukuru export-translations -f translations.tsutproj
working-directory: src/translations

- name: Check for modified files
id: git-pending
run: echo ::set-output name=modified::$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)

- name: Push changes
if: steps.git-pending.outputs.modified == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m '[automated] export latest translations from project'
git push
Loading

0 comments on commit e3799ac

Please sign in to comment.