forked from winfunc/opcode
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (109 loc) · 4.88 KB
/
Copy pathrelease.yml
File metadata and controls
135 lines (109 loc) · 4.88 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., v1.0.0)'
required: true
type: string
permissions:
contents: write
jobs:
# Build jobs for each platform
build-linux:
uses: ./.github/workflows/build-linux.yml
secrets: inherit
build-macos:
uses: ./.github/workflows/build-macos.yml
secrets: inherit
# Continue even if macOS build fails (e.g., missing Apple signing secrets in forks)
continue-on-error: true
build-windows:
uses: ./.github/workflows/build-windows.yml
secrets: inherit
# Create release after all builds complete
create-release:
name: Create Release
needs: [build-linux, build-macos, build-windows]
# Run even if macOS build failed
if: always() && needs.build-linux.result == 'success' && needs.build-windows.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "push" ]; then
VERSION="${GITHUB_REF#refs/tags/}"
else
VERSION="${{ inputs.version }}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release-assets
# Linux artifacts
if [ -d "artifacts/linux-x86_64" ]; then
cp artifacts/linux-x86_64/*.deb release-assets/opcode_${{ steps.version.outputs.version }}_linux_x86_64.deb || true
cp artifacts/linux-x86_64/*.AppImage release-assets/opcode_${{ steps.version.outputs.version }}_linux_x86_64.AppImage || true
fi
# macOS artifacts
if [ -d "artifacts/macos-universal" ]; then
cp artifacts/macos-universal/opcode.dmg release-assets/opcode_${{ steps.version.outputs.version }}_macos_universal.dmg || true
cp artifacts/macos-universal/opcode.app.zip release-assets/opcode_${{ steps.version.outputs.version }}_macos_universal.app.tar.gz || true
fi
# Windows artifacts
if [ -d "artifacts/windows-x86_64" ]; then
cp artifacts/windows-x86_64/*.msi release-assets/opcode_${{ steps.version.outputs.version }}_windows_x86_64.msi || true
cp artifacts/windows-x86_64/*.exe release-assets/opcode_${{ steps.version.outputs.version }}_windows_x86_64_setup.exe || true
fi
# Create source code archives
# Clean version without 'v' prefix for archive names
CLEAN_VERSION="${{ steps.version.outputs.version }}"
CLEAN_VERSION="${CLEAN_VERSION#v}"
# Create source code archives (excluding .git and other unnecessary files)
echo "Creating source code archives..."
# Create a clean export of the repository
git archive --format=tar.gz --prefix=opcode-${CLEAN_VERSION}/ -o release-assets/opcode-${CLEAN_VERSION}.tar.gz HEAD
git archive --format=zip --prefix=opcode-${CLEAN_VERSION}/ -o release-assets/opcode-${CLEAN_VERSION}.zip HEAD
# Generate signatures for all files
cd release-assets
for file in *; do
if [ -f "$file" ]; then
sha256sum "$file" > "$file.sha256"
fi
done
cd ..
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.version }}
name: opcode ${{ steps.version.outputs.version }}
draft: true
prerelease: false
generate_release_notes: true
files: release-assets/*
body: |
<div align="center">
<img src="https://raw.githubusercontent.com/${{ github.repository }}/${{ steps.version.outputs.version }}/src-tauri/icons/icon.png" alt="opcode Logo" width="128" height="128">
</div>
## opcode ${{ steps.version.outputs.version }}
This release was built and signed by CI. Artifacts for macOS and Linux are attached below.
- Auto-generated release notes are included below (commits, PRs, and contributors).
- Checksums (`.sha256`) are provided for all assets.
### Downloads
- macOS: `.dmg`, `.app.tar.gz` (Universal: Apple Silicon + Intel)
- Linux: `.AppImage`, `.deb`
- Windows: `.msi`, `.exe` installer
### Installation
- macOS: Open the `.dmg` and drag opcode to Applications.
- Linux: `chmod +x` the `.AppImage` and run it, or install the `.deb` on Debian/Ubuntu.
- Windows: Run the `.msi` or `.exe` installer.