Skip to content

Swift

Swift #36498

Workflow file for this run

name: Swift
on:
push:
branches: [ "main" ]
schedule:
- cron: '0 * * * *'
workflow_dispatch:
jobs:
build:
runs-on: macos-15
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
fetch-depth: 0
- name: Get Credentials
if: github.event_name != 'pull_request'
env:
CLOUDKIT_KEY_BASE64: ${{ secrets.CLOUDKIT_KEY_BASE64 }}
run: |
CLOUDKIT_KEY_PATH=$RUNNER_TEMP/key.pem
echo -n "$CLOUDKIT_KEY_BASE64" | base64 --decode --output $CLOUDKIT_KEY_PATH
- name: Build
run: swift build -v
- name: Synchronize (Category Names)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf category-titles
.build/debug/SynchronizerApp category-titles ResourceCategory localizedName --english-key name --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add category-titles
- name: Synchronize (Category Fallback Names)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf category-fallback-names
.build/debug/SynchronizerApp category-fallback-names ResourceCategory fallbackName --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add category-fallback-names
- name: Synchronize (Category Descriptions)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf category-descriptions
.build/debug/SynchronizerApp category-descriptions ResourceCategory localizedDescription --english-key description --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add category-descriptions
- name: Synchronize (Addon Names)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf addon-titles
.build/debug/SynchronizerApp addon-titles ResourceItem localizedName --english-key name --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add addon-titles
- name: Synchronize (Addon Descriptions)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf addon-descriptions
.build/debug/SynchronizerApp addon-descriptions ResourceItem localizedDescription --english-key description --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add addon-descriptions
- name: Synchronize (Addon Rich Descriptions)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf addon-rich-descriptions
.build/debug/SynchronizerApp addon-rich-descriptions ResourceItem localizedHTMLReferences data --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add addon-rich-descriptions
- name: Synchronize (Guide Titles)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf guide-titles
.build/debug/SynchronizerApp guide-titles Guide localizedTitles --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add guide-titles
- name: Synchronize (Guide Descriptions)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf guide-descriptions
.build/debug/SynchronizerApp guide-descriptions Guide localizedDescriptions --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add guide-descriptions
- name: Synchronize (Guide Content)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
rm -rf guide-content
.build/debug/SynchronizerApp guide-content Guide localizedHTMLReferences data --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git add guide-content
- name: Commit
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
run: |
if [[ `git status --porcelain` ]]; then
git commit -m "Synchronize"
git fetch origin
git rebase origin/main
git push
fi
- name: Upload (Category Names)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r category-titles new-category-titles
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp category-titles new-category-titles localizedName --english-key name --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT
- name: Upload (Category Fallback Names)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r category-fallback-names new-category-fallback-names
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp category-fallback-names new-category-fallback-names fallbackName --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT
- name: Upload (Category Descriptions)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r category-descriptions new-category-descriptions
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp category-descriptions new-category-descriptions localizedDescription --english-key description --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT
- name: Upload (Addon Names)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r addon-titles new-addon-titles
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp addon-titles new-addon-titles localizedName --english-key name --keywords-key keywords --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT
- name: Upload (Addon Descriptions)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r addon-descriptions new-addon-descriptions
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp addon-descriptions new-addon-descriptions localizedDescription --english-key description --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT
- name: Upload (Addon Rich Descriptions)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r addon-rich-descriptions new-addon-rich-descriptions
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp addon-rich-descriptions new-addon-rich-descriptions localizedHTMLReferences data --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT
- name: Upload (Guide Titles)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r guide-titles new-guide-titles
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp guide-titles new-guide-titles localizedTitles --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT
- name: Upload (Guide Descriptions)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r guide-descriptions new-guide-descriptions
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp guide-descriptions new-guide-descriptions localizedDescriptions --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT
- name: Upload (Guide Content)
if: github.event_name == 'push'
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
if [ "`git show -s --format='%an'`" = "runner" ]; then
echo "Ignore runner commit"
exit 0
fi
cp -r guide-content new-guide-content
CURRENT_COMMIT=`git show -s --format='%H'`
git reset --hard HEAD^
.build/debug/UploaderApp guide-content new-guide-content localizedHTMLReferences data --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID
git reset --hard $CURRENT_COMMIT