-
Notifications
You must be signed in to change notification settings - Fork 6
217 lines (192 loc) · 6.71 KB
/
release.yml
File metadata and controls
217 lines (192 loc) · 6.71 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: Create Release
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to build (e.g., v7.1.4)'
required: true
type: string
build_windows:
description: 'Build Windows executable'
required: false
type: boolean
default: true
build_macos:
description: 'Build macOS executable'
required: false
type: boolean
default: false
build_linux:
description: 'Build Linux executable'
required: false
type: boolean
default: false
jobs:
# Get the version from the input tag
get-version:
runs-on: ubuntu-latest
outputs:
build_version: ${{ steps.version.outputs.build_version }}
steps:
- name: Set version from input
id: version
run: |
VERSION="${{ inputs.tag }}"
# Ensure version starts with 'v'
if [[ ! "$VERSION" =~ ^v ]]; then
VERSION="v$VERSION"
fi
echo "build_version=$VERSION" >> $GITHUB_OUTPUT
echo "Building version: $VERSION"
# Build the JAR first
build:
needs: [get-version]
uses: ./.github/workflows/jar-only.yml
with:
ref: ${{ inputs.tag }}
version: ${{ needs.get-version.outputs.build_version }}
secrets:
VMS_URL: ${{ secrets.VMS_URL }}
VMS_AUTH_TOKEN: ${{ secrets.VMS_AUTH_TOKEN }}
# Package for Windows
package-windows:
if: ${{ inputs.build_windows }}
needs: [build]
uses: ./.github/workflows/conveyor.yml
with:
platform: windows-zip
secrets:
CONVEYOR_ROOT_KEY: ${{ secrets.CONVEYOR_ROOT_KEY }}
# Sign the Windows package
sign-windows:
if: ${{ inputs.build_windows }}
needs: [get-version, package-windows]
uses: ./.github/workflows/sign.yml
with:
version: ${{ needs.get-version.outputs.build_version }}
secrets:
AZURE_SIGNING_ALIAS: ${{ secrets.AZURE_SIGNING_ALIAS }}
AZURE_SIGNING_REGION: ${{ secrets.AZURE_SIGNING_REGION }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
# Package for macOS (Intel)
package-macos-amd64:
if: ${{ inputs.build_macos }}
needs: [build]
uses: ./.github/workflows/conveyor.yml
with:
platform: notarized-mac-zip
arch: mac.amd64
secrets:
CONVEYOR_ROOT_KEY: ${{ secrets.CONVEYOR_ROOT_KEY }}
APPLE_SIGNING_P12_ENCODED: ${{ secrets.APPLE_SIGNING_P12_ENCODED }}
APPLE_SIGNING_KEY: ${{ secrets.APPLE_SIGNING_KEY }}
MAC_NOTARY_ISSUER: ${{ secrets.MAC_NOTARY_ISSUER }}
MAC_NOTARY_KEY: ${{ secrets.MAC_NOTARY_KEY }}
MAC_NOTARY_PRIVATE_KEY_ENCODED: ${{ secrets.MAC_NOTARY_PRIVATE_KEY_ENCODED }}
# Package for macOS (Apple Silicon)
package-macos-aarch64:
if: ${{ inputs.build_macos }}
needs: [build]
uses: ./.github/workflows/conveyor.yml
with:
platform: notarized-mac-zip
arch: mac.aarch64
secrets:
CONVEYOR_ROOT_KEY: ${{ secrets.CONVEYOR_ROOT_KEY }}
APPLE_SIGNING_P12_ENCODED: ${{ secrets.APPLE_SIGNING_P12_ENCODED }}
APPLE_SIGNING_KEY: ${{ secrets.APPLE_SIGNING_KEY }}
MAC_NOTARY_ISSUER: ${{ secrets.MAC_NOTARY_ISSUER }}
MAC_NOTARY_KEY: ${{ secrets.MAC_NOTARY_KEY }}
MAC_NOTARY_PRIVATE_KEY_ENCODED: ${{ secrets.MAC_NOTARY_PRIVATE_KEY_ENCODED }}
# Package for Linux
package-linux:
if: ${{ inputs.build_linux }}
needs: [build]
uses: ./.github/workflows/conveyor.yml
with:
platform: debian-package
secrets:
CONVEYOR_ROOT_KEY: ${{ secrets.CONVEYOR_ROOT_KEY }}
# Create the release
create-release:
needs: [get-version, build, sign-windows, package-macos-amd64, package-macos-aarch64, package-linux]
if: always() && needs.build.result == 'success'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
fetch-depth: 0
- name: Generate release notes
id: release-notes
run: |
# Get commit messages between origin/main and current tag
NOTES=$(git log origin/main..HEAD --pretty=format:"- %s" --no-merges 2>/dev/null || echo "- Initial release")
# Store in file for multi-line handling
echo "$NOTES" > release-notes.txt
# Also set as output (escaped for GitHub Actions)
{
echo 'notes<<EOF'
cat release-notes.txt
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Set version
run: |
echo "version=${{ needs.get-version.outputs.build_version }}" >> "$GITHUB_ENV"
DATE=$(date '+%Y-%m-%d')
echo "date=$DATE" >> "$GITHUB_ENV"
- name: Generate downloads list
id: downloads
run: |
VERSION="${{ needs.get-version.outputs.build_version }}"
{
echo 'list<<EOF'
if [[ "${{ inputs.build_windows }}" == "true" ]]; then
echo "- **Windows**: \`behave-${VERSION}-windows-amd64.zip\` (signed)"
fi
if [[ "${{ inputs.build_macos }}" == "true" ]]; then
echo "- **macOS (Intel)**: \`behave-${VERSION}-mac-amd64.zip\`"
echo "- **macOS (Apple Silicon)**: \`behave-${VERSION}-mac-aarch64.zip\`"
fi
if [[ "${{ inputs.build_linux }}" == "true" ]]; then
echo "- **Linux**: \`behave-${VERSION}.deb\`"
fi
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts/
- name: Display structure
run: ls -R release-artifacts/
- name: Rename JAR with version
run: |
cd release-artifacts/behave7-jar
mv behave7.jar behave-${{ env.version }}.jar
- name: Create Release
uses: ncipollo/release-action@v1
with:
name: "${{ env.version }} (${{ env.date }})"
artifacts: |
release-artifacts/behave7-jar/*.jar
release-artifacts/windows-zip-signed/**/*.zip
release-artifacts/mac-zip/**/*.zip
release-artifacts/linux-deb/**/*.deb
artifactContentType: application/octet-stream
tag: ${{ inputs.tag }}
makeLatest: true
body: |
# Behave 7 Release - ${{ env.version }}
Released on ${{ env.date }}
## Downloads
### Desktop Applications
${{ steps.downloads.outputs.list }}
### JAR File
- **Universal JAR**: `behave-${{ env.version }}.jar`
## Release Notes
${{ steps.release-notes.outputs.notes }}