-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (33 loc) · 1.34 KB
/
auto-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Auto Updated
on:
schedule:
- cron: "0 04 * * *"
workflow_dispatch:
jobs:
check-new-release:
name: "Check for new releases"
runs-on: "ubuntu-latest"
steps:
- id: new-release
run: |
JULIA_FONT_VERSION=$(curl -s https://api.github.com/repos/cormullion/juliamono/releases/latest | jq -r .tag_name | tr -d "[:space:]")
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")
if [ ! "${JULIA_FONT_VERSION}" = "${JULIA_NERD_FONT_VERSION}" ]; then
echo "release=TRUE" >> $GITHUB_OUTPUT
echo "version=${JULIA_FONT_VERSION}" >> $GITHUB_OUTPUT
else
echo "release=FALSE" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v4
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Repository Dispatch
if: ${{ steps.new-release.outputs.release == 'TRUE' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.generate-token.outputs.token }}
event-type: new-release-published
client-payload: '{"version": "${{ steps.new-release.outputs.version }}"}'