-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (111 loc) · 4.27 KB
/
Copy pathbuild-pd-curses.yml
File metadata and controls
126 lines (111 loc) · 4.27 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: 🐍 Refresh PDCurses
on:
workflow_dispatch:
schedule:
- cron: "0 9 1 1-12 *"
jobs:
windows-x64:
name: 🪟 Windows x64
runs-on: windows-2022
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@master
with:
repository: wmcbrine/PDCurses
ref: refs/heads/master
- name: ⚙️ Setup environment
id: setup-environment
uses: ilammy/msvc-dev-cmd@v1
- name: 🛠️ Build library
id: build-library
run: |
cd wincon
nmake WIDE=Y DLL=Y -f Makefile.vc
ren pdcurses.dll libpdcurses-wincon-x64.dll
- name: ⬆️ Upload artifacts
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: libraries-windows-x64-wincon
path: "wincon/*.dll"
if-no-files-found: error
create-pr:
name: 📝 Create pull request
runs-on: ubuntu-latest
needs: [windows-x64]
outputs:
pr_created: ${{ steps.create-pull-request.outputs.pull-request-number != '' }}
pr_number: ${{ steps.create-pull-request.outputs.pull-request-number }}
files_changed: ${{ steps.check-changes.outputs.files_changed }}
steps:
- name: ☁️ Clone repository
id: checkout-repository
uses: actions/checkout@v4
- name: 📥 Download artifacts
id: download-artifact
uses: actions/download-artifact@v4.1.7
with:
pattern: libraries*
merge-multiple: true
path: lib/pdcurses
- name: 🔍 Check for changes
id: check-changes
run: |
if git diff --quiet HEAD -- lib/pdcurses/; then
echo "files_changed=false" >> $GITHUB_OUTPUT
else
echo "files_changed=true" >> $GITHUB_OUTPUT
fi
- name: 🔼 Bump version
id: bump-version
if: steps.check-changes.outputs.files_changed == 'true'
run: |
sed -i "s|<PdCursesVersion>.*</PdCursesVersion>|<PdCursesVersion>$(shell date +%Y.%m.%d)</PdCursesVersion>|" NativeLibraries/Sharpie.NativeLibraries.PdCurses.csproj
- name: 📝 Create pull request
id: create-pull-request
uses: peter-evans/create-pull-request@v6
with:
commit-message: (chore) Update PDCurses native libraries.
committer: Alexandru Ciobanu <alex+git[bot]@ciobanu.org>
author: Alexandru Ciobanu <alex+git[bot]@ciobanu.org>
title: Update PDCurses native library to latest master.
body: This is an auto-generated PR with native library updates.
delete-branch: true
labels: dependencies
assignees: pavkam
branch: pdcurses-lib-update
summary:
name: ✔︎ Generate summary
runs-on: ubuntu-latest
needs: [windows-x64, create-pr]
if: ${{ always() }}
steps:
- name: 📝 Create summary
id: create-summary
shell: bash
run: |
echo "## 🐍 PDCurses Library Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Status | Library Changes |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|----------------|" >> $GITHUB_STEP_SUMMARY
# Check build job status
if [ "${{ needs.windows-x64.result }}" = "success" ]; then
echo "| Windows x64 | ✅ Success |" >> $GITHUB_STEP_SUMMARY
else
echo "| Windows x64 | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📝 Pull Request Status" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Check if PR was created and files changed
if [ "${{ needs.create-pr.outputs.pr_created }}" = "true" ]; then
if [ "${{ needs.create-pr.outputs.files_changed }}" = "true" ]; then
echo "| Status | 🔄 PR Created with Changes |" >> $GITHUB_STEP_SUMMARY
echo "| PR Number | #${{ needs.create-pr.outputs.pr_number }} |" >> $GITHUB_STEP_SUMMARY
else
echo "| Status | ⏭️ No Changes - No PR Created |" >> $GITHUB_STEP_SUMMARY
fi
else
echo "| Status | ❌ PR Creation Failed |" >> $GITHUB_STEP_SUMMARY
fi