Skip to content

Commit

Permalink
Merge branch 'icon-updates-chore/changeOutput' into chore/changeOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
thelukewalton committed Aug 2, 2024
2 parents 8e7a115 + 9c16b37 commit 55aa479
Show file tree
Hide file tree
Showing 8 changed files with 4,942 additions and 1 deletion.
80 changes: 80 additions & 0 deletions .github/workflows/copy-content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Copy content to other repository

on:
workflow_call:
inputs:
repo:
required: true
type: string
branch:
required: true
type: string
source_dir:
required: true
type: string
destination_dir:
required: true
type: string
secrets:
PAT:
required: true

jobs:
copy_content:
runs-on: ubuntu-latest
steps:
- name: Check if existing tokens branch exists
id: check_branch
run: echo "branch_exists=$(git ls-remote --heads https://github.com/${{ inputs.repo }}.git refs/heads/${{ inputs.branch }} | wc -l)" >> $GITHUB_OUTPUT
- name: Check if open PR exists
id: check_pr
run: echo "pr_exists=$(gh pr list -R ${{ inputs.repo }} -H ${{ inputs.branch }} --json number -q length)" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4
- name: Pull latest changes
run: git pull
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Push files if branch exists
uses: dmnemec/copy_file_to_another_repo_action@main
if: ${{ steps.outputs.check_branch.branch_exists == 1 }}
env:
API_TOKEN_GITHUB: ${{ secrets.PAT }}
with:
source_file: ${{ inputs.source_dir }}
destination_repo: ${{ inputs.repo }}
destination_folder: ${{ inputs.destination_dir }}
destination_branch: ${{ inputs.branch }}
user_email: "[email protected]"
user_name: "Zeta Tokens Bot"
commit_message: "deps(automated): Update tokens ${{ steps.date.outputs.date }}"
- name: Push files if branch does not exist
uses: dmnemec/copy_file_to_another_repo_action@main
if: ${{ steps.outputs.check_branch.branch_exists == 0 }}
env:
API_TOKEN_GITHUB: ${{ secrets.PAT }}
with:
source_file: ${{ inputs.source_dir }}
destination_repo: ${{ inputs.repo }}
destination_folder: ${{ inputs.destination_dir }}
destination_branch_create: ${{ inputs.branch }}
user_email: "[email protected]"
user_name: "Zeta Tokens Bot"
commit_message: "deps(automated): Update tokens ${{ steps.date.outputs.date }}"
- name: Open PR
uses: thecanadianroot/[email protected]
if: ${{ steps.outputs.check_pr.pr_exists == 0 }}
with:
token: ${{ secrets.PAT }}
base: main
head: ${{ inputs.branch }}
title: "deps(automated): Update tokens"
labels: tokens
body: "Update tokens ${{ steps.date.outputs.date }}"
repository: ${{ inputs.repo }}
- name: Add comment to existing PR
env:
GH_TOKEN: ${{ secrets.PAT }}
if: ${{ steps.outputs.check_pr.pr_exists != 0 }}
run: gh pr comment -R ${{ inputs.repo }} ${{ inputs.branch }} --body "Update tokens ${{ steps.date.outputs.date }}"
2 changes: 1 addition & 1 deletion .github/workflows/update_zeta_flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
publish_flutter: #TODO: Rename this to deploy, I think that is a better name
uses: ./.github/workflows/copy-content.yml@UX-1145
uses: ./.github/workflows/copy-content.yml
needs: generate_tokens
if: ${{ needs.generate_tokens.outputs.changes == 'true' }}
secrets: inherit
Expand Down
3,784 changes: 3,784 additions & 0 deletions outputs/dart/icons.dart

Large diffs are not rendered by default.

Binary file added outputs/dart/zeta-icons-round.ttf
Binary file not shown.
Binary file added outputs/dart/zeta-icons-sharp.ttf
Binary file not shown.
Loading

0 comments on commit 55aa479

Please sign in to comment.