-
Notifications
You must be signed in to change notification settings - Fork 81
130 lines (120 loc) · 3.79 KB
/
Copy pathrelease.yml
File metadata and controls
130 lines (120 loc) · 3.79 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
name: Build/publish release binaries (Linux, Mac)
on:
# push:
# # Trigger on version tags: v4.10 etc.
# tags:
# - 'v*'
# Allows manual triggering
workflow_dispatch:
inputs:
tag_name:
description: 'Target tag (e.g., v4.10)'
required: true
type: string
do_publish:
description: 'Upload to the GitHub release?'
required: true
type: boolean
default: false
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: prism-linux64-x86
- os: ubuntu-22.04-arm
artifact_name: prism-linux64-arm
- os: macos-latest
artifact_name: prism-mac64-arm
- os: macos-15-intel
artifact_name: prism-mac64-x86
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
# Use the tag from manual input, otherwise fall back to the git ref
ref: ${{ github.event.inputs.tag_name || github.ref }}
fetch-depth: 0 # Fetches all tags and history
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Build
shell: bash
working-directory: ./prism
run: |
make release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: prism/release/*.tar.gz
test_release:
needs: build
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: prism-linux64-x86
- os: ubuntu-22.04-arm
artifact_name: prism-linux64-arm
- os: macos-latest
artifact_name: prism-mac64-arm
- os: macos-15-intel
artifact_name: prism-mac64-x86
runs-on: ${{ matrix.os }}
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: test-dir
- name: Verify download
run: ls -R test-dir/
- name: Build and run smoke test
shell: bash
working-directory: ./test-dir
run: |
tar -xzf prism*.tar.gz
rm prism*.tar.gz
cd prism-*
./install.sh
etc/tests/run.sh
publish:
needs: [build, test_release]
runs-on: ubuntu-latest
permissions:
# Crucial for creating releases
contents: write
if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.do_publish == 'true'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
# This downloads all job artifacts into subfolders
path: ./artifacts
- name: Organize files and Generate Checksums
# Move files from subfolders into one flat directory for the release
shell: bash
run: |
mkdir -p release-assets
find ./artifacts -type f \( -name "*.tar.gz" -o -name "*.exe" -o -name "*.zip" \) -exec cp {} ./release-assets/ \;
cd release-assets
sha256sum * > checksums.txt
echo "Assets to be published:"
ls -lh
- name: Create or update GitHub release
uses: softprops/action-gh-release@v2
with:
# Use the tag from manual input, otherwise fall back to the git ref
tag_name: ${{ github.event.inputs.tag_name || github.ref_name }}
# Upload files (omit checksums for now)
files: |
release-assets/*.tar.gz
release-assets/*.exe
release-assets/*.zip
# These are safe even if the release exists; it won't overwrite your text
generate_release_notes: false
draft: false