-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (83 loc) · 3.35 KB
/
release-macos.yml
File metadata and controls
97 lines (83 loc) · 3.35 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
name: release macos
on:
push:
tags:
- 'release-*'
- 'v*'
jobs:
build-macos-release:
runs-on: macos-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Fetch dependencies
- name: Fetch dependencies
run: |
cd ..
git clone https://github.com/razterizer/Core.git
# Step 3: Build project
- name: Build project
run: |
cd Examples
./build_examples.sh
continue-on-error: false
# Step 4: Upload build artifact
- name: Upload macOS build artifact
uses: actions/upload-artifact@v4
with:
name: termin8or_examples-macos-build
path: Examples/bin/
retention-days: 1
create-macos-release:
runs-on: ubuntu-latest
needs: build-macos-release
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download macOS build artifact
uses: actions/download-artifact@v4
with:
name: termin8or_examples-macos-build
path: macos-build
- name: Create macOS distribution package
run: |
cd macos-build
# Create a clean distribution folder
mkdir -p termin8or_examples-${{ github.ref_name }}
# Copy the executable and necessary files
chmod ugo+x examples
cp examples termin8or_examples-${{ github.ref_name }}/
# Copy background.tx and colors.tx
cp -r background.tx termin8or_examples-${{ github.ref_name }}/
cp -r 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 the gatekeeper that this executable is fine" >> termin8or_examples-${{ github.ref_name }}/README.txt
echo " you can unblock the executable with" >> termin8or_examples-${{ github.ref_name }}/README.txt
echo " the following command:" >> termin8or_examples-${{ github.ref_name }}/README.txt
echo " xattr -dr com.apple.quarantine examples" >> termin8or_examples-${{ github.ref_name }}/README.txt
# Create zip archive
zip -r termin8or_examples-${{ github.ref_name }}-macos.zip termin8or_examples-${{ github.ref_name }}/
- name: Extract tag annotation as release notes
id: notes
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: macos-build/termin8or_examples-${{ github.ref_name }}-macos.zip
allowUpdates: true
bodyFile: RELEASE_NOTES.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}