-
Notifications
You must be signed in to change notification settings - Fork 15
162 lines (142 loc) · 4.75 KB
/
Copy pathdesktop_release.yml
File metadata and controls
162 lines (142 loc) · 4.75 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Desktop Release
permissions:
contents: write
on:
push:
tags:
- 'v*'
env:
RELEASE_ALLOWED_OWNER: FalconGCS
RELEASE_ALLOWED_ACTOR: 1Blademaster
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
authorize:
name: Authorize Release Actor
runs-on: ubuntu-latest
steps:
- name: Validate release owner and actor
shell: bash
run: |
if [[ "${GITHUB_REPOSITORY_OWNER}" != "${RELEASE_ALLOWED_OWNER}" ]]; then
echo "Release blocked: repository owner '${GITHUB_REPOSITORY_OWNER}' is not '${RELEASE_ALLOWED_OWNER}'."
exit 1
fi
if [[ "${GITHUB_ACTOR}" != "${RELEASE_ALLOWED_ACTOR}" ]]; then
echo "Release blocked: actor '${GITHUB_ACTOR}' is not '${RELEASE_ALLOWED_ACTOR}'."
exit 1
fi
echo "Release authorized for ${GITHUB_ACTOR} on ${GITHUB_REPOSITORY}."
prepare:
name: Prepare Release Metadata
needs: authorize
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.meta.outputs.tag }}
version: ${{ steps.meta.outputs.version }}
prerelease: ${{ steps.meta.outputs.prerelease }}
steps:
- name: Validate tag and extract version
id: meta
shell: bash
run: |
TAG="${GITHUB_REF_NAME}"
VERSION="${TAG#v}"
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
echo "Invalid release tag: $TAG"
echo "Expected format: vX.Y.Z or vX.Y.Z-suffix"
exit 1
fi
PRERELEASE="false"
# if [[ "$VERSION" == *-* ]] || [[ "$VERSION" == *alpha* ]] || [[ "$VERSION" == *beta* ]] || [[ "$VERSION" == *rc* ]]; then
# PRERELEASE="true"
# fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "prerelease=$PRERELEASE" >> "$GITHUB_OUTPUT"
- name: Create draft release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.meta.outputs.tag }}
name: FGCS ${{ steps.meta.outputs.tag }}
draft: true
prerelease: ${{ steps.meta.outputs.prerelease == 'true' }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build ${{ matrix.name }}
needs: prepare
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows x64
os: windows-latest
platform: windows
arch: x64
- name: macOS x64
os: macos-13
platform: mac
arch: x64
- name: macOS arm64
os: macos-latest
platform: mac
arch: arm64
env:
VERSION: ${{ needs.prepare.outputs.version }}
RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
steps:
- name: Check out Git repository
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build on Windows
if: matrix.platform == 'windows'
shell: pwsh
working-directory: building/windows
run: |
python -m venv radio\venv
.\radio\venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r radio\requirements.txt
.\building\windows\build.ps1 -Version "$env:VERSION" -Arch "${{ matrix.arch }}"
- name: Build on macOS
if: matrix.platform == 'mac'
shell: bash
working-directory: building/macos
run: |
python3 -m venv radio/venv
source radio/venv/bin/activate
python3 -m pip install --upgrade pip
pip install -r radio/requirements.txt
chmod +x building/macos/build.sh
./building/macos/build.sh "$VERSION" "${{ matrix.arch }}"
- name: Upload Windows installer
if: matrix.platform == 'windows'
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ env.RELEASE_TAG }}
draft: true
files: |
gcs/release/${{ env.VERSION }}/FGCS-Windows-${{ env.VERSION }}-Setup.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload macOS installer
if: matrix.platform == 'mac'
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ env.RELEASE_TAG }}
draft: true
files: |
gcs/release/${{ env.VERSION }}/FGCS-Mac-${{ env.VERSION }}-Installer-${{ matrix.arch }}.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}