-
Notifications
You must be signed in to change notification settings - Fork 15
72 lines (60 loc) · 2.1 KB
/
sync-materialdesign.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: 🔄 Material Design
# https://stackoverflow.com/a/58468828
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * 0"
defaults:
run:
working-directory: src/Projektanker.Icons.Avalonia.MaterialDesign
jobs:
sync:
name: 🔄 Sync Material Design
runs-on: ubuntu-latest
outputs:
modified: ${{ steps.git-check.outputs.modified }}
steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 📥 Download repository archive
run: wget -O archive.zip https://github.com/Templarian/MaterialDesign-SVG/archive/master.zip
- name: 📦 unzip archive
run: unzip archive.zip -d temp
- name: 🧹 Clear Assets directory
run: rm ./Assets/*
- name: 🚚 Move *.svg to Assets directory
run: find temp -iname '*.svg' -type f -exec mv -nv -t 'Assets' -- {} +
- name: 🧹 Remove temporary files
run: |
rm -r ./temp
rm archive.zip
- name: ℹ git status
run: git status
- name: 🔎 Check for modified files
id: git-check
run: echo modified=$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") >> $GITHUB_OUTPUT
- name: 🟣 Setup .NET 7.0
if: ${{ steps.git-check.outputs.modified == 'true' }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: 🧪 dotnet test
if: ${{ steps.git-check.outputs.modified == 'true' }}
run: dotnet test --configuration Release
- name: 💬 Commit and push
if: ${{ steps.git-check.outputs.modified == 'true' }}
run: |
git config --global user.name '${{ secrets.GIT_USER }}'
git config --global user.email '${{ secrets.GIT_EMAIL }}'
git add .
git commit -m "feat(Material Design): 🔄 icons changed."
git push
release-please:
name: ✨ Release Please
needs: sync
if: ${{ needs.sync.outputs.modified == 'true' }}
uses: ./.github/workflows/call-release-please.yml
secrets:
nuget_api_key: ${{ secrets.NUGET_API_KEY }}