-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (98 loc) · 4.22 KB
/
release-windows.yml
File metadata and controls
116 lines (98 loc) · 4.22 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
name: release windows
on:
push:
tags:
- 'release-*'
- 'v*'
jobs:
build-windows-release:
runs-on: windows-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Move to the parent directory and fetch dependencies
- name: Fetch dependencies
run: |
cd ..
git clone https://github.com/razterizer/Core.git
# Step 3: Build project
- name: Run build.bat
continue-on-error: false
run: |
cd $env:GITHUB_WORKSPACE\Examples
./build_examples.bat
- name: Debug - List ALL files after build
run: |
cd $env:GITHUB_WORKSPACE
echo "=== Full directory structure ==="
Get-ChildItem -Recurse -File | Select-Object Name, Directory | Format-Table
- name: Prepare files for upload
run: |
New-Item -ItemType Directory -Force -Path "upload-temp"
Copy-Item "Examples/examples.vs/x64/Release/examples.vs.exe" "upload-temp/"
Copy-Item "Examples/background.tx" "upload-temp/"
Copy-Item "Examples/colors.tx" "upload-temp/"
# Step 4: Upload build artifact
- name: Upload Windows build artifact
uses: actions/upload-artifact@v4
with:
name: termin8or_examples-windows-build
path: upload-temp/
retention-days: 1
create-windows-release:
runs-on: windows-latest
needs: build-windows-release
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Windows build artifact
uses: actions/download-artifact@v4
with:
name: termin8or_examples-windows-build
path: windows-build
- name: Debug - List downloaded files
run: |
cd windows-build
echo "=== Downloaded files ==="
Get-ChildItem -Recurse
- name: Create Windows distribution package
run: |
cd windows-build
# Create a clean distribution folder
New-Item -ItemType Directory -Force -Path "termin8or_examples-${{ github.ref_name }}"
# Copy the executable and necessary files
Copy-Item "examples.vs.exe" "termin8or_examples-${{ github.ref_name }}/"
# Copy background.tx and colors.tx
Copy-Item "background.tx" "termin8or_examples-${{ github.ref_name }}/"
Copy-Item "colors.tx" "termin8or_examples-${{ github.ref_name }}/"
echo "Unblock instructions:" > termin8or_examples-${{ github.ref_name }}/README.txt
echo "=====================" >> termin8or_examples-${{ github.ref_name }}/README.txt
echo "To tell Windows that this executable is fine" >> termin8or_examples-${{ github.ref_name }}/README.txt
echo " you can unblock the executable by" >> termin8or_examples-${{ github.ref_name }}/README.txt
echo " rightclicking the exe, then:" >> termin8or_examples-${{ github.ref_name }}/README.txt
echo " Properties -> Unblock (check this)." >> termin8or_examples-${{ github.ref_name }}/README.txt
# Create zip archive
Compress-Archive -Path "termin8or_examples-${{ github.ref_name }}" -DestinationPath "termin8or_examples-${{ github.ref_name }}-windows.zip"
- name: Extract tag annotation as release notes
shell: bash
run: |
git fetch --tags --force
TAG="${{ github.ref_name }}"
git tag -l --format='%(contents)' "$TAG" > RELEASE_NOTES.txt
echo "Release notes extracted from tag annotation:"
cat RELEASE_NOTES.txt
- name: Debug Show ref info
run: |
echo "github.ref: ${{ github.ref }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.event_name: ${{ github.event_name }}"
- name: Upload package to release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
artifacts: windows-build/termin8or_examples-${{ github.ref_name }}-windows.zip
allowUpdates: true
bodyFile: RELEASE_NOTES.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}