Skip to content

Commit a2bf609

Browse files
committed
Update CI Scripts
1 parent 5016ee3 commit a2bf609

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

.github/workflows/auto-update.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,19 @@ jobs:
1616
JULIA_NERD_FONT_VERSION=$(curl -s https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest | jq -r .tag_name | tr -d "[:space:]" || echo -n "v0")
1717
if [ ! "${JULIA_FONT_VERSION}" = "${JULIA_NERD_FONT_VERSION}" ]; then
1818
echo "release=TRUE" >> $GITHUB_OUTPUT
19-
echo "version=${JULIA_FONT_VERSION}"
19+
echo "version=${JULIA_FONT_VERSION}" >> $GITHUB_OUTPUT
2020
else
2121
echo "release=FALSE" >> $GITHUB_OUTPUT
2222
fi
23-
- name: Trigger patch-font.yaml
24-
if: ${{ steps.new-release.outputs.release == 'TRUE' }}
25-
run: gh workflow run patch-font.yml -f version=${{ steps.new-release.outputs.version }}
23+
- uses: actions/checkout@v4
24+
- uses: actions/create-github-app-token@v1
25+
id: generate-token
26+
with:
27+
app-id: ${{ secrets.APP_ID }}
28+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
29+
- name: Repository Dispatch
30+
uses: peter-evans/repository-dispatch@v3
31+
with:
32+
token: ${{ steps.generate-token.outputs.token }}
33+
event-type: new-release-published
34+
client-payload: '{"version": "${{ steps.new-release.outputs.version }}"}'

.github/workflows/patch-font.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,28 @@ on:
66
version:
77
description: 'juliamono version'
88
required: true
9-
default: 'v0.053'
9+
default: 'v0.054'
1010
type: string
11+
repository_dispatch:
12+
types: [new-release-published]
1113

1214
permissions:
1315
contents: write
1416

1517
jobs:
1618
patch:
1719
runs-on: ubuntu-latest
20+
env:
21+
version: ${{ github.event.client_payload.version || inputs.version }}
1822
steps:
19-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2024
with:
2125
path: juliamono-nerd-font
2226

23-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2428
with:
2529
repository: 'cormullion/juliamono'
26-
ref: ${{ inputs.version }}
30+
ref: ${{ env.version }}
2731
path: juliamono
2832

2933
- name: Patch
@@ -33,26 +37,24 @@ jobs:
3337
zip -j font.zip juliamono-nerd-font/font/*
3438
3539
- name: Commit and Push
36-
env:
37-
GH_TOKEN: ${{ github.token }}
3840
run: |
3941
cd juliamono-nerd-font
4042
git config --local user.email "131801252+merger-bot[bot]@users.noreply.github.com"
4143
git config --local user.name "merger-bot[bot]"
42-
sed "s%\[\*\*Download\*\*\].*%\[\*\*Download\*\*\](https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ inputs.version }}/font.zip)%g" README.md
44+
sed "s%\[\*\*Download\*\*\].*%\[\*\*Download\*\*\](https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ env.version }}/font.zip)%g" README.md
4345
git add .
44-
git commit -m 'Updated juliamono-nerd-font to ${{ inputs.version }}'
46+
git commit -m 'Updated juliamono-nerd-font to ${{ env.version }}'
4547
git push
4648
47-
- uses: tibdex/github-app-token@v1
49+
- uses: actions/create-github-app-token@v1
4850
id: generate-token
4951
with:
50-
app_id: ${{ secrets.APP_ID }}
51-
private_key: ${{ secrets.APP_PRIVATE_KEY }}
52+
app-id: ${{ secrets.APP_ID }}
53+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
5254

5355
- uses: "softprops/action-gh-release@v1"
5456
with:
5557
token: ${{ steps.generate-token.outputs.token }}
56-
tag_name: ${{ inputs.version }}
58+
tag_name: ${{ env.version }}
5759
generate_release_notes: true
5860
files: font.zip

0 commit comments

Comments
 (0)