Skip to content

Add commands and workflows to handle translations #542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 5, 2021
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: per1234 <accounts@perglass.com>
  • Loading branch information
silvanocerza and per1234 committed Nov 4, 2021
commit 4f63a886e4322bcb4c94eef677b22338658e0fe0
30 changes: 1 addition & 29 deletions .github/workflows/check-i18n-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,31 @@ env:

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
create:
push:
paths:
- '.github/workflows/check-i18n-task.ya?ml'
- 'package.json'
- '**/package.json'
- '**.ts'
- 'i18n/**'
pull_request:
paths:
- '.github/workflows/check-i18n-task.ya?ml'
- 'package.json'
- '**/package.json'
- '**.ts'
- 'i18n/**'
workflow_dispatch:
repository_dispatch:

jobs:
run-determination:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
- name: Determine if the rest of the workflow should run
id: determination
run: |
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
if [[ \
"${{ github.event_name }}" != "create" || \
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX \
]]; then
# Run the other jobs.
RESULT="true"
else
# There is no need to run the other jobs.
RESULT="false"
fi

echo "::set-output name=result::$RESULT"

check:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js 12.x
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: '12.14.1'
registry-url: 'https://registry.npmjs.org'
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/i18n-nightly-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ on:

jobs:
push-to-transifex:
# This workflow is only of value to the arduino/arduino-ide repository and
# would always fail in forks
if: github.repository == 'arduino/arduino-ide'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js 12.x
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: '12.14.1'
registry-url: 'https://registry.npmjs.org'
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/i18n-weekly-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ on:

jobs:
pull-from-transifex:
# This workflow is only of value to the arduino/arduino-ide repository and
# would always fail in forks
if: github.repository == 'arduino/arduino-ide'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js 12.x
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: '12.14.1'
registry-url: 'https://registry.npmjs.org'
Expand All @@ -33,6 +30,6 @@ jobs:
uses: peter-evans/create-pull-request@v3
with:
commit-message: Updated translation files
title: Updated translation files
title: Update translation files
branch: i18n/translations-update
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>