-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5458cc8
commit 87e6ea4
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Prepare for translation | ||
on: | ||
push: | ||
branches: | ||
- 'pre-release' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
tmate_enabled: | ||
type: boolean | ||
description: 'Enable "tmate" for debugging' | ||
required: false | ||
default: false | ||
|
||
jobs: | ||
check: | ||
name: Check the POT file and prepare for translation | ||
env: | ||
# ISSUE_ASSIGNEE: wocmultimedia | ||
ISSUE_ASSIGNEE: andergmartins | ||
# ISSUE_CC: "@wocmultimedia, @andergmartins, @stevejburge" | ||
ISSUE_CC: "@andergmartins" | ||
GH_TOKEN: ${{ github.token }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@master | ||
|
||
- name: Setup tmate session for Debugging, if inputs.tmate_enabled is true | ||
uses: mxschmitt/action-tmate@v3 | ||
if: ${{ inputs.tmate_enabled }} | ||
timeout-minutes: 10 | ||
|
||
- name: Prepare composer | ||
run: | | ||
$GITHUB_WORKSPACE/dev-workspace/run composer validate | ||
$GITHUB_WORKSPACE/dev-workspace/run composer install | ||
- name: Show version of tools inside the dev-workspace | ||
run: | | ||
$GITHUB_WORKSPACE/dev-workspace/run composer info:versions | ||
# - name: Run POT file check against the main branch | ||
# run: | | ||
# OUTPUT=$($GITHUB_WORKSPACE/dev-workspace/run composer check:pot-diff-md) | ||
# PLUGIN_VERSION=${{ steps.get-plugin-version.outputs.PLUGIN_VERSION }} | ||
# echo "Checking for changes in POT file for version $PLUGIN_VERSION" | ||
# echo "$OUTPUT" | ||
# echo "" | ||
# if [[ ! "$OUTPUT" =~ "No messages found" ]]; then | ||
# # Check if issue already exists | ||
# ISSUE_EXISTS=$(gh issue list --search "POT file has changes that need to be reviewed for version $PLUGIN_VERSION in:title is:open" --json number --jq 'length') | ||
# if [ "$ISSUE_EXISTS" -eq 0 ]; then | ||
# echo "" | ||
# echo "No issue found, creating a new one" | ||
# gh issue create \ | ||
# --title "POT file has changes that need to be reviewed for version $PLUGIN_VERSION" \ | ||
# --body "The POT file check detected changes between the main branch and the current branch.<br />Please review and update the PO files.<br /><br />CC: $ISSUE_CC<br /><br />Output of \`check:pot-diff\`:<br />$OUTPUT" \ | ||
# --label "translation" \ | ||
# --assignee "$ISSUE_ASSIGNEE" | ||
# else | ||
# ISSUE_NUMBER=$(gh issue list --search "POT file has changes that need to be reviewed for version $PLUGIN_VERSION in:title" --json number --jq '.[0].number') | ||
# echo "" | ||
# echo "Changes found" | ||
# echo "Commenting on issue $ISSUE_NUMBER" | ||
# gh issue comment $ISSUE_NUMBER --body "Additional changes detected in the repository for version $PLUGIN_VERSION. Please review the latest differences below.<br /><br />CC: $ISSUE_CC<br /><br />Latest output of \`check:pot-diff\`:<br />$OUTPUT" | ||
# fi | ||
# fi | ||
|
||
- name: Get the current version number and store it in a variable | ||
id: get-plugin-version | ||
run: | | ||
PLUGIN_VERSION=$($GITHUB_WORKSPACE/dev-workspace/run pversion) | ||
echo "Current version: $PLUGIN_VERSION" | ||
echo "PLUGIN_VERSION=$PLUGIN_VERSION" >> $GITHUB_OUTPUT | ||
- name: Build the testing package and get its url for download | ||
id: build-testing-package | ||
run: | | ||
$GITHUB_WORKSPACE/dev-workspace/run composer build | ||
ZIPFILE_NAME=$($GITHUB_WORKSPACE/dev-workspace/run pzipfile) | ||
echo "ZIPFILE_NAME=$ZIPFILE_NAME" >> $GITHUB_OUTPUT | ||
ls -lha $GITHUB_WORKSPACE/dist/ | ||
- name: Upload zip as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.build-testing-package.outputs.ZIPFILE_NAME }} | ||
path: $GITHUB_WORKSPACE/dist/${{ steps.build-testing-package.outputs.ZIPFILE_NAME }} | ||
retention-days: 7 | ||
|
||
- name: Echo the URL for the artifact | ||
run: | | ||
echo "Artifact URL: ${{ steps.upload-artifact.outputs.artifact_url }}" |