-
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (70 loc) · 3.04 KB
/
build-pr.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
73
74
75
76
77
78
79
80
---
name: "Build zip for PR"
on:
issue_comment:
types: [created]
jobs:
compile_launcher:
runs-on: windows-latest
if: github.event.issue.pull_request && contains(github.event.comment.body, '/build')
steps:
- name: Fetch Branch Name
id: fetch-branch-name
uses: xt0rted/pull-request-comment-branch@v2
- name: Checkout PR branch (${{ steps.fetch-branch-name.outputs.head_ref }})
uses: actions/checkout@v4
with:
ref: ${{ steps.fetch-branch-name.outputs.head_ref }}
- name: Compile Exe
run: |
cd app\launcher;
Invoke-WebRequest "https://github.com/AutoHotkey/Ahk2Exe/releases/download/Ahk2Exe1.1.37.01c1/Ahk2Exe1.1.37.01c1.zip" -OutFile "$cwd\ahk2exe.zip";
Invoke-WebRequest "https://www.autohotkey.com/download/ahk-v2.zip" -OutFile "$cwd\ahk.zip";
Expand-Archive -Path "$cwd\ahk2exe.zip" -DestinationPath . -Force;
Expand-Archive -Path "$cwd\ahk.zip" -DestinationPath . -Force;
& .\Ahk2Exe.exe /in "dqxclarity.ahk" /base "AutoHotkey64.exe" /icon "img/rosie.ico";
- name: Upload exe
uses: actions/upload-artifact@v4
with:
name: dqxclarity.exe
path: app\launcher\dqxclarity.exe
if-no-files-found: error
retention-days: 1
overwrite: true
build:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && contains(github.event.comment.body, '/build')
steps:
- name: Fetch Branch Name
id: fetch-branch-name
uses: xt0rted/pull-request-comment-branch@v2
- name: Checkout PR branch (${{ steps.fetch-branch-name.outputs.head_ref }})
uses: actions/checkout@v4
with:
ref: ${{ steps.fetch-branch-name.outputs.head_ref }}
- name: Download exe
uses: actions/download-artifact@v4
with:
name: dqxclarity.exe
- name: Create SHORT_SHA env
run: echo "SHORT_SHA=`echo ${{ steps.fetch-branch-name.outputs.head_sha }} | cut -c1-8`" >> $GITHUB_ENV
- name: Build package
run: |
rsync -av --exclude="imgs/" --exclude="launcher/" app/* dqxclarity/;
cp version.update requirements.txt user_settings.ini dqxclarity/;
cp clarity_dialog.db dqxclarity/misc_files;
zip -r dqxclarity-dev-${SHORT_SHA}.zip dqxclarity
- name: Upload zip as artifact
uses: actions/upload-artifact@v4
with:
name: dqxclarity-dev-${{ env.SHORT_SHA }}
path: dqxclarity-dev-${{ env.SHORT_SHA }}.zip
if-no-files-found: error
- name: Post comment to PR
uses: mshick/add-pr-comment@v2
with:
message: |
Link to workflow: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Click on the zip at the bottom of the workflow to download.
refresh-message-position: true
preformatted: false