Skip to content

Generate Sponsor and Contributor Images #1487

Generate Sponsor and Contributor Images

Generate Sponsor and Contributor Images #1487

name: Generate Sponsor and Contributor Images
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
update-sponsors:
name: Update Sponsors and Contributors
runs-on: ubuntu-latest
if: github.repository == 'wailsapp/wails'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: Update Sponsors
run: cd tools/sponsorkit && go run . -login leaanthony -out ../../website/static/img/sponsors.svg
env:
SPONSORKIT_GITHUB_TOKEN: ${{ secrets.SPONSORS_TOKEN }}
GOWORK: "off"
- name: Update Contributors
run: cd tools/sponsorkit && go run . -mode contributors -metric prs -repo wailsapp/wails -changelogs ../../docs/src/content/docs/changelog.mdx,../../website/src/pages/changelog.mdx -out ../../website/static/img/contributors.svg
env:
SPONSORKIT_GITHUB_TOKEN: ${{ secrets.SPONSORS_TOKEN }}
GOWORK: "off"
- name: Commit updated images
id: commit-images
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if git diff --quiet -- website/static/img/sponsors.svg website/static/img/contributors.svg; then
echo "No sponsor or contributor changes to commit."
echo "changed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
git add website/static/img/sponsors.svg website/static/img/contributors.svg
git commit -m "chore: update sponsors.svg and contributors.svg [skip ci]"
echo "changed=true" >> "$GITHUB_OUTPUT"
- name: Push updated images
if: steps.commit-images.outputs.changed == 'true'
env:
WAILS_PUSH_TOKEN: ${{ secrets.WAILS_REPO_TOKEN || github.token }}
run: git push "https://x-access-token:${WAILS_PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:${GITHUB_REF_NAME}"