Skip to content

Adding HD 25295

Adding HD 25295 #9550

Workflow file for this run

name: Swift
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: macos-15
permissions:
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
fetch-depth: 0
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
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: Validate (Apple ID)
if: github.event_name == 'pull_request' && always()
run: |
set -o pipefail
for file in `git diff --name-only --diff-filter=A origin/$GITHUB_BASE_REF`; do
if [[ "$file" != pending/* ]]; then
continue
fi
id=${file##pending/}
.build/debug/CelestiaAddonValidatorApp --api-token 377f2dcc6bf5c3a841914799d07a4b3e6f82a6e2a30b41697e246933eef06370 --record-id $id
done 2>&1 | tee /tmp/validate_appleid.txt
- name: Validate
if: github.event_name == 'pull_request' && always()
run: |
set -o pipefail
for file in `git diff --name-only --diff-filter=A origin/$GITHUB_BASE_REF`; do
if [[ "$file" != pending_zip/* ]]; then
continue
fi
.build/debug/CelestiaAddonValidatorApp --api-token 377f2dcc6bf5c3a841914799d07a4b3e6f82a6e2a30b41697e246933eef06370 --zip-file-path $file
done 2>&1 | tee /tmp/validate_zip.txt
# - name: Post Validation Results
# if: github.event_name == 'pull_request' && always()
# uses: actions/github-script@v7
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# const fs = require('fs');
# let appleidOutput = '';
# let zipOutput = '';
# try { appleidOutput = fs.readFileSync('/tmp/validate_appleid.txt', 'utf8'); } catch (e) { appleidOutput = 'No output'; }
# try { zipOutput = fs.readFileSync('/tmp/validate_zip.txt', 'utf8'); } catch (e) { zipOutput = 'No output'; }
# const body = `## Validation Results\n\n### Validate (Apple ID)\n\`\`\`\n${appleidOutput}\n\`\`\`\n\n### Validate (Zip)\n\`\`\`\n${zipOutput}\n\`\`\``;
# await github.rest.issues.createComment({
# owner: context.repo.owner,
# repo: context.repo.repo,
# issue_number: context.issue.number,
# body: body
# });
- name: Upload (Apple ID)
if: github.event_name != 'pull_request' && always()
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
for file in `git diff --name-only --diff-filter=A HEAD^`; do
if [[ "$file" != pending/* ]]; then
continue
fi
id=${file##pending/}
.build/debug/CelestiaAddonValidatorApp --upload --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID --record-id $id
git rm pending/$id
done
- name: Upload
if: github.event_name != 'pull_request' && always()
env:
CLOUDKIT_KEY_ID: ${{ secrets.CLOUDKIT_KEY_ID }}
run: |
for file in `git diff --name-only --diff-filter=A HEAD^`; do
if [[ "$file" != pending_zip/* ]]; then
continue
fi
.build/debug/CelestiaAddonValidatorApp --upload --key-file-path $RUNNER_TEMP/key.pem --key-id $CLOUDKIT_KEY_ID --zip-file-path $file
git rm $file
done
- name: Clean Up
if: github.event_name != 'pull_request' && always()
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: |
if [[ `git status --porcelain` ]]; then
git commit -m "Cleaning up"
git fetch origin
git rebase origin/main
git push
fi